From 261a8690f4a7a87c768d6a331600ca0b2bd0e941 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sat, 16 Apr 2016 18:06:42 +0300 Subject: [PATCH] some refactoring... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/filesystem.js | 13 ++++++++++++- ui (gen4)/features/ui-widgets.js | 10 +++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ui (gen4)/features/filesystem.js b/ui (gen4)/features/filesystem.js index 306e967a..c9994fe1 100755 --- a/ui (gen4)/features/filesystem.js +++ b/ui (gen4)/features/filesystem.js @@ -1198,6 +1198,8 @@ var FileSystemWriterUIActions = actions.Actions({ 'export-preview-size')) }, + // XXX make this editable on open and remove "new" from history... + // XXX add "history" button... 'target_dir': function(actions, make, overlay){ return make(['To: ', function(){ return actions.config['export-path'] || './' }], @@ -1219,8 +1221,17 @@ var FileSystemWriterUIActions = actions.Actions({ // XXX ugly... overlay.focus() }) - }] + }], + ['histroy', widgets.makeNestedConfigListEditor(actions, overlay, + 'export-paths', + 'export-path', + { + new_button: false, + // XXX add 'edit' button... + //itemButtons: [] + })], ]}) + // XXX make this editable??? .on('open', widgets.makeNestedConfigListEditor(actions, overlay, 'export-paths', diff --git a/ui (gen4)/features/ui-widgets.js b/ui (gen4)/features/ui-widgets.js index 29108c58..83b6ad1c 100755 --- a/ui (gen4)/features/ui-widgets.js +++ b/ui (gen4)/features/ui-widgets.js @@ -114,15 +114,19 @@ function(actions, list_key, options){ .push(txt) // unique... - if(options.unique){ + if(options.unique == null || options.unique){ actions.config[list_key] = actions.config[list_key] - .unique(options.unique !== true ? options.unique : undefined) + .unique(typeof(options.unique) == typeof(function(){}) ? + options.unique + : undefined) } // sort... if(options.sort){ actions.config[list_key] = actions.config[list_key] - .sort(options.sort !== true ? options.sort : undefined) + .sort(typeof(options.sort) == typeof(function(){}) ? + options.sort + : undefined) } // update the list data...