now proto event handlers are not triggered...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-08-04 16:48:28 +03:00
parent 5155c09661
commit 72909c35b2
2 changed files with 12 additions and 5 deletions

View File

@ -132,9 +132,12 @@ object.Constructor('Eventful', {
return this },
unbind: function(context, handler){
var handlers =
(this.handlerLocation == 'method' ?
this.handlerLocation == 'method' ?
method.__event_handlers__
: (context.__event_handlers__ || {})[this.name]) || []
//: (context.__event_handlers__ || {})[this.name]) || []
: context.hasOwnProperty('__event_handlers__') ?
(context.__event_handlers__ || {})[this.name] || []
: []
handlers.splice(0, handlers.length,
...handlers.filter(function(h){
return h !== handler
@ -150,7 +153,10 @@ object.Constructor('Eventful', {
// context (default)...
// NOTE: these are allways called...
handlers = handlers
.concat((context.__event_handlers__ || {})[this.name] || [])
//.concat((context.__event_handlers__ || {})[this.name] || [])
.concat(context.hasOwnProperty('__event_handlers__') ?
(context.__event_handlers__ || {})[this.name] || []
: [])
// NOTE: this will stop event handling if one of the handlers
// explicitly returns false...
@ -334,7 +340,8 @@ module.EventHandlerMixin = object.Mixin('EventHandlerMixin', {
evt in this ?
// XXX add a better check...
this[evt](module.TRIGGER, ...args)
: this.__event_handlers__
//: this.__event_handlers__
: this.hasOwnProperty('__event_handlers__')
&& (this.__event_handlers__[evt] || [])
.forEach(function(h){ h(evt, ...args) })
return this },

View File

@ -1,6 +1,6 @@
{
"name": "ig-types",
"version": "6.16.2",
"version": "6.16.3",
"description": "Generic JavaScript types and type extensions...",
"main": "main.js",
"scripts": {