zjquery: Add get_on_handler().

This commit is contained in:
Aditya Bansal
2017-07-06 05:08:28 +05:30
committed by Steve Howell
parent 641b38f79b
commit 9c90a3d1a3

View File

@@ -86,6 +86,11 @@ exports.make_zjquery = function () {
assert.equal(idx, 0); assert.equal(idx, 0);
return selector; return selector;
}, },
get_on_handler: function (name, child_selector) {
var funcs = self.get_on_handlers(name, child_selector);
assert.equal(funcs.length, 1, 'We expected to have exactly one handler here.');
return funcs[0];
},
get_on_handlers: function (name, child_selector) { get_on_handlers: function (name, child_selector) {
if (child_selector === undefined) { if (child_selector === undefined) {
return on_functions.get(name) || []; return on_functions.get(name) || [];