From 0edc34f47044f2af31ca4c245a3e80b9b246fb7e Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Tue, 25 Apr 2017 17:20:45 +0300 Subject: [PATCH] docs... Signed-off-by: Alex A. Naanou --- ui (gen4)/lib/toggler.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ui (gen4)/lib/toggler.js b/ui (gen4)/lib/toggler.js index 384c9a0d..60211642 100755 --- a/ui (gen4)/lib/toggler.js +++ b/ui (gen4)/lib/toggler.js @@ -107,8 +107,13 @@ // state_accessor(, ) // -> // -// `this' within is set to toggler's context. -// +// `this' within state_accessor is set to toggler's context. +// +// The value returned by state_accessor is returned by the toggler. To pass +// control over the return value back to the Toggler logic when setting +// the state (i.e. when is passed) state_accessor has to +// return null. +// // NOTE: for single state toggling, 'none' will get passed to // state_accessor to indicate an "empty" state... // NOTE: if elem is a function it will be called in the same context as @@ -257,7 +262,7 @@ function(elem, state_accessor, states, callback_a, callback_b){ // pre callback... if(callback_pre != null){ if(callback_pre.apply(this, [action, e].concat(args)) === false){ - //return + // return current state... return func.call(this, '?') } }