|
|
|
@ -64,11 +64,10 @@
|
|
|
|
|
if (this.options.listeners != null) { |
|
|
|
|
_.each(this.options.listeners, function (lis, eventName) { |
|
|
|
|
if (_.isFunction(lis)) { |
|
|
|
|
self.on(eventName, _.bind(lis, self)); |
|
|
|
|
self.on(eventName, lis); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
(lis.target ? lis.target : self)[lis.once ? "once" : "on"] |
|
|
|
|
(lis.eventName, _.bind(lis.action, self)); |
|
|
|
|
(lis.target ? lis.target : self)[lis.once ? "once" : "on"](lis.eventName, lis.action); |
|
|
|
|
}); |
|
|
|
|
delete this.options.listeners; |
|
|
|
|
} |
|
|
|
|