diff --git a/ui (gen4)/features/ui-widgets.js b/ui (gen4)/features/ui-widgets.js index 38bb14e3..6f2c0c70 100755 --- a/ui (gen4)/features/ui-widgets.js +++ b/ui (gen4)/features/ui-widgets.js @@ -124,7 +124,8 @@ function(cls, cfg, parent){ parent = parent == null ? this.ribbons.viewer : parent instanceof Function ? parent.call(this) : parent - return parent.find('.'+ cls.join('.')).length > 0 ? 'on' : 'off' }, + return parent.find('.'+ cls.join('.')).length > 0 ? 'on' : 'off' + }, ['off', 'on'], function(state){ if(state == 'on'){ diff --git a/ui (gen4)/lib/toggler.js b/ui (gen4)/lib/toggler.js index 149ecc96..0e3ac651 100755 --- a/ui (gen4)/lib/toggler.js +++ b/ui (gen4)/lib/toggler.js @@ -265,15 +265,15 @@ function(elem, state_accessor, states, callback_a, callback_b){ // update the element... //state_accessor.call(this, e, state) var res = state_accessor.call(this, e, state) - action = res !== undefined ? res : action + //action = res !== undefined ? res : action // post callback... if(callback_post != null){ - var res = callback_post.apply(this, [action, e].concat(args)) - action = res !== undefined ? res : action + var r = callback_post.apply(this, [action, e].concat(args)) + action = r !== undefined ? r : action } - return action + return res || action } // XXX these are broken -- this is wrong...