Skip to content

Commit

Permalink
fix: use me.$ vs $element.constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelkaron committed Apr 9, 2017
1 parent 517428d commit 62bd05c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions widget.js
Expand Up @@ -31,16 +31,14 @@
},
"on/_remove": function () {
var me = this;
var $element = me.$element;
var finalized = $element.constructor.Callbacks("once");
finalized.fire($element.triggerHandler("finalize." + me.ns, finalized.add));
var finalized = me.$.Callbacks("once");
finalized.fire(me.$element.triggerHandler("finalize." + me.ns, finalized.add));
}
};

["on", "one"].forEach(function (op) {
this[op] = function (events, selector, data, handler) {
var me = this;
var $element = me.$element;

switch (arguments.length) {
case 3:
Expand All @@ -58,7 +56,7 @@
throw new Error("not enough arguments");
}

$element[op](name.call(events, me.ns), selector, data, $element.constructor.proxy(handler, me));
me.$element[op](name.call(events, me.ns), selector, data, me.$.proxy(handler, me));
};
}, widget);

Expand Down

0 comments on commit 62bd05c

Please sign in to comment.