forked from 0x2620/oxjs
.bind -> .on, .unbind -> .off
This commit is contained in:
parent
f45f993f42
commit
461a237880
22 changed files with 54 additions and 54 deletions
|
|
@ -23,7 +23,7 @@ Ox.Event = (function() {
|
|||
that.bind = function() {
|
||||
Ox.forEach(Ox.makeObject(arguments), function(callback, event) {
|
||||
var foo = event;
|
||||
self.$eventHandler.bind('ox_' + event, function(event, data) {
|
||||
self.$eventHandler.on('ox_' + event, function(event, data) {
|
||||
Ox.Log('Core', 'CALLBACK', foo, data.value);
|
||||
callback(data.value);
|
||||
});
|
||||
|
|
@ -82,10 +82,10 @@ Ox.Event = (function() {
|
|||
@*/
|
||||
that.unbind = function() {
|
||||
if (arguments.length == 0) {
|
||||
self.$eventHandler.unbind();
|
||||
self.$eventHandler.off();
|
||||
} else {
|
||||
Ox.toArray(arguments).forEach(function(event) {
|
||||
self.$eventHandler.unbind('ox_' + event);
|
||||
self.$eventHandler.off('ox_' + event);
|
||||
});
|
||||
}
|
||||
return that;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue