minor fix + docs...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-11-07 18:21:32 +03:00
parent 14a326cf40
commit 42da8c67f0

View File

@ -22,16 +22,21 @@ var toggler = require('lib/toggler')
/*********************************************************************/ /*********************************************************************/
var protocolAction = // Make a protocol implementation action...
//
// For more docs see: docs for actions.js and .chainApply(..)
//
// XXX might be good to move this to actions.js
var protocol =
module.protocol = function(protocol, func){ module.protocol = function(protocol, func){
return function(){ return function(){
this[protocol].chainCall(this, func, arguments) return this[protocol].chainApply(this, func, arguments)
} }
} }
// NOTE: if not state is set this assumes that the first state is the // NOTE: if no toggler state is set this assumes that the first state
// default... // is the default...
var makeConfigToggler = var makeConfigToggler =
module.makeConfigToggler = module.makeConfigToggler =
function(attr, states, a, b){ function(attr, states, a, b){
@ -62,6 +67,9 @@ function(attr, states, a, b){
// Root ImageGrid.viewer object constructor... // Root ImageGrid.viewer object constructor...
// //
// This adds:
// - toggler as action compatibility
//
var ImageGridMetaActions = var ImageGridMetaActions =
module.ImageGridMetaActions = { module.ImageGridMetaActions = {
// Test if the action is a Toggler... // Test if the action is a Toggler...
@ -72,6 +80,9 @@ module.ImageGridMetaActions = {
// Handle special cases where we need to get the action result early, // Handle special cases where we need to get the action result early,
// without calling handlers... // without calling handlers...
// //
// These include:
// - toggler action special command handling (like: '?', '??', ..)
//
preActionHandler: actions.doWithRootAction(function(action, name, handlers, args){ preActionHandler: actions.doWithRootAction(function(action, name, handlers, args){
// Special case: do not call handlers for toggler state queries... // Special case: do not call handlers for toggler state queries...
// //