ig-types 6.16.2 → 6.16.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/event.js +11 -4
- package/package.json +1 -1
package/event.js
CHANGED
|
@@ -132,9 +132,12 @@ object.Constructor('Eventful', {
|
|
|
132
132
|
return this },
|
|
133
133
|
unbind: function(context, handler){
|
|
134
134
|
var handlers =
|
|
135
|
-
|
|
135
|
+
this.handlerLocation == 'method' ?
|
|
136
136
|
method.__event_handlers__
|
|
137
|
-
|
|
137
|
+
//: (context.__event_handlers__ || {})[this.name]) || []
|
|
138
|
+
: context.hasOwnProperty('__event_handlers__') ?
|
|
139
|
+
(context.__event_handlers__ || {})[this.name] || []
|
|
140
|
+
: []
|
|
138
141
|
handlers.splice(0, handlers.length,
|
|
139
142
|
...handlers.filter(function(h){
|
|
140
143
|
return h !== handler
|
|
@@ -150,7 +153,10 @@ object.Constructor('Eventful', {
|
|
|
150
153
|
// context (default)...
|
|
151
154
|
// NOTE: these are allways called...
|
|
152
155
|
handlers = handlers
|
|
153
|
-
|
|
156
|
+
//.concat((context.__event_handlers__ || {})[this.name] || [])
|
|
157
|
+
.concat(context.hasOwnProperty('__event_handlers__') ?
|
|
158
|
+
(context.__event_handlers__ || {})[this.name] || []
|
|
159
|
+
: [])
|
|
154
160
|
|
|
155
161
|
// NOTE: this will stop event handling if one of the handlers
|
|
156
162
|
// explicitly returns false...
|
|
@@ -334,7 +340,8 @@ module.EventHandlerMixin = object.Mixin('EventHandlerMixin', {
|
|
|
334
340
|
evt in this ?
|
|
335
341
|
// XXX add a better check...
|
|
336
342
|
this[evt](module.TRIGGER, ...args)
|
|
337
|
-
|
|
343
|
+
//: this.__event_handlers__
|
|
344
|
+
: this.hasOwnProperty('__event_handlers__')
|
|
338
345
|
&& (this.__event_handlers__[evt] || [])
|
|
339
346
|
.forEach(function(h){ h(evt, ...args) })
|
|
340
347
|
return this },
|