From 27149b087089333ba6bec880c65d35399678ce07 Mon Sep 17 00:00:00 2001 From: Ezequiel Bergamaschi Date: Sat, 27 Sep 2014 14:35:40 -0300 Subject: [PATCH] reducing functionality of Events class --- mindplot/src/main/javascript/Events.js | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/mindplot/src/main/javascript/Events.js b/mindplot/src/main/javascript/Events.js index 775175d9..e449afb5 100644 --- a/mindplot/src/main/javascript/Events.js +++ b/mindplot/src/main/javascript/Events.js @@ -16,11 +16,6 @@ mindplot.Events = new Class({ return this; }, - addEvents: function(events){ - for (var type in events) this.addEvent(type, events[type]); - return this; - }, - fireEvent: function(type, args, delay){ type = this._removeOn(type); var events = this.$events[type]; @@ -38,24 +33,7 @@ mindplot.Events = new Class({ var events = this.$events[type]; if (events && !fn.internal){ var index = events.indexOf(fn); - if (index != -1) delete events[index]; - } - return this; - }, - - removeEvents: function(events){ - var type; - if (typeOf(events) == 'object'){ - for (type in events) this.removeEvent(type, events[type]); - return this; - } - if (events) events = removeOn(events); - for (type in this.$events){ - if (events && events != type) continue; - var fns = this.$events[type]; - for (var i = fns.length; i--;) if (i in fns){ - this.removeEvent(type, fns[i]); - } + if (index != -1) events.splice(index, 1); } return this; }