diff --git a/ui (gen4)/features/core.js b/ui (gen4)/features/core.js index 0f06d13b..16845009 100755 --- a/ui (gen4)/features/core.js +++ b/ui (gen4)/features/core.js @@ -54,77 +54,6 @@ var toggler = require('lib/toggler') /*********************************************************************/ -// Make a chained action... -// -// // basic chained action... -// basicAction: ['Group/Basic action', -// core.chain('working', -// // action... -// function(){ -// ... -// })], -// -// // conditional chained action... -// conditionalAction: ['Group/Conditional action', -// core.chain('working', -// // action predicate... -// function(){ -// return ... -// }, -// // action... -// function(){ -// ... -// })], -// -// -// For more docs see: docs for actions.js and .chainApply(..) -// -// XXX might be good to move this to actions.js -// XXX might also be a good idea to mark the actual protocol definition -// and not just the implementation... -// XXX is this actually simpler? -// conditionalActionNew: ['Group/Conditional action', -// core.chain('working', -// function(){ -// return this.condition == true -// }, -// function(){ -// ... -// })], -// -// conditionalActionOld: ['Group/Conditional action', -// function(){ -// if(this.condition != true){ -// return -// } -// this.working.chainApply(this, function(){ -// ... -// }) -// }], -// -// Advantages: -// - documentable/groupable automatically... -// -// Disadvantages: -// - extra entity/abstraction to remember... -// - covers only one simple case.. -var chain = -module.chain = function(action, a, b){ - if(arguments.length == 3){ - var func = b - var cond = a - } else { - var func = a - var cond = true - } - return function(){ - if(cond === true || cond.apply(this, arguments)){ - return this[action].chainApply(this, func, arguments) - } - } -} - - // NOTE: if no toggler state is set this assumes that the first state // is the default... // NOTE: default states is [false, true]