1
0
Fork 0
forked from 0x2620/oxjs

.bind -> .on, .unbind -> .off

This commit is contained in:
rolux 2012-05-28 16:06:22 +02:00
commit 461a237880
22 changed files with 54 additions and 54 deletions

View file

@ -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;