jQuery.NumPad icon indicating copy to clipboard operation
jQuery.NumPad copied to clipboard

How to get the caller object?

Open miicha opened this issue 9 years ago • 1 comments

Is it somehow possible to access the caller object (especially attributes or parent attributes) within e.g. the onKeypadOpen: function () {

miicha avatar Apr 27 '16 18:04 miicha

This is almost 2 years old but for good measure:

It looks like the event context of onKeypadOpen is the numpad itself, rather than the target object. Nothing else is passed into the onKeypadOpen trigger.

However, onKeypadOpen is triggered from within the nmpd.open(target, initialValue) function so you can modify the nmpd.trigger('numpad.open'); line to nmpd.trigger('numpad.open', target); if you would like your initial target to be accessible.

You would access that within your onKeypadOpen like so:

onKeypadOpen: function (event, target) {
    // do something with target
}

orionstudt avatar Mar 20 '18 14:03 orionstudt