mirror of
https://github.com/swc-project/swc.git
synced 2024-12-23 05:32:09 +03:00
20 lines
626 B
JavaScript
20 lines
626 B
JavaScript
|
export const obj = {
|
||
|
removeEvents: function(events) {
|
||
|
var type;
|
||
|
if ("object" == typeOf(events)) {
|
||
|
for(type in events)this.removeEvent(type, events[type]);
|
||
|
return this;
|
||
|
}
|
||
|
var attached = this.retrieve("events");
|
||
|
if (!attached) return this;
|
||
|
if (events) attached[events] && (attached[events].keys.each(function(fn) {
|
||
|
this.removeEvent(events, fn);
|
||
|
}, this), delete attached[events]);
|
||
|
else {
|
||
|
for(type in attached)this.removeEvents(type);
|
||
|
this.eliminate("events");
|
||
|
}
|
||
|
return this;
|
||
|
}
|
||
|
};
|