From d6f1e40844ad37bf3db93042e958f1ad7a2f5de6 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sat, 12 Mar 2016 02:16:32 +0300 Subject: [PATCH] added inline states for togglers in action list/tree... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/history.js | 1 + ui (gen4)/features/ui-widgets.js | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ui (gen4)/features/history.js b/ui (gen4)/features/history.js index dbc4217f..de7d6e9a 100755 --- a/ui (gen4)/features/history.js +++ b/ui (gen4)/features/history.js @@ -349,6 +349,7 @@ module.URLHistoryFSWriter = core.ImageGridFeatures.Feature({ ], config: { + // XXX should we add a toggler action to toggle this? 'url-history-push-to-top-on-save': false, }, diff --git a/ui (gen4)/features/ui-widgets.js b/ui (gen4)/features/ui-widgets.js index 9a538faa..cd18e542 100755 --- a/ui (gen4)/features/ui-widgets.js +++ b/ui (gen4)/features/ui-widgets.js @@ -38,7 +38,11 @@ var makeActionLister = function(list, filter, pre_order){ pre_order = typeof(filter) == typeof(true) ? filter : pre_order filter = typeof(filter) == typeof(true) ? null : filter - return function(path){ + return function(path, inline_state){ + inline_state = inline_state == null ? + that.config['actions-list-show-toggler-state-inline'] + : inline_state + var that = this var paths = this.getPath() var actions = {} @@ -91,7 +95,9 @@ var makeActionLister = function(list, filter, pre_order){ } states.forEach(function(state){ - actions[k +'/'+ state + (cur == state ? ' *': '')] = + //actions[k +'/'+ state + (cur == state ? ' *': '')] = + actions[k +(inline_state ? (' ('+ cur +')') : '') + +'/'+ state + (cur == state ? ' *': '')] = function(){ that[n](state) } @@ -138,6 +144,8 @@ var BrowseActionsActions = actions.Actions({ 'Navigate/', ], + 'actions-list-show-toggler-state-inline': true, + 'browse-actions-settings': { showDisabled: false, },