minor tweaking/refactoring...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2019-05-27 01:49:47 +03:00
parent 146b059938
commit e8670825cd

View File

@ -444,7 +444,7 @@ var makeItemEventToggler = function(get_state, set_state, unset_state, default_i
'!': '!', '!': '!',
} }
return function(item, state){ return (function eventToggler(item, state){
var that = this var that = this
// normalize/parse args... // normalize/parse args...
state = item in states ? state = item in states ?
@ -489,7 +489,11 @@ var makeItemEventToggler = function(get_state, set_state, unset_state, default_i
.run(function(){ .run(function(){
return this.length == 1 ? return this.length == 1 ?
this[0] this[0]
: this }) } } : this }) })
// support instanceof Toggler tests...
.run(function(){
this.__proto__ = toggler.Toggler.prototype
this.constructor = toggler.Toggler })}
// XXX this is incomplete... // XXX this is incomplete...
var makeItemEventToggler2 = function(get_state, set_state, unset_state, default_item, multi){ var makeItemEventToggler2 = function(get_state, set_state, unset_state, default_item, multi){
var _get_state = get_state instanceof Function ? var _get_state = get_state instanceof Function ?