jQuery.NumPad
jQuery.NumPad copied to clipboard
How to get the caller object?
Is it somehow possible to access the caller object (especially attributes or parent attributes) within e.g. the onKeypadOpen: function () {
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
}