From 573ce76333482b4505324f6ee8f16166a11a56f1 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 18 Apr 2016 03:05:48 +0300 Subject: [PATCH] some minor stuff and fixes... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/filesystem.js | 21 ++++++++++++--------- ui (gen4)/features/ui-widgets.js | 14 +++++++++----- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/ui (gen4)/features/filesystem.js b/ui (gen4)/features/filesystem.js index 4fc95df9..4372bbcf 100755 --- a/ui (gen4)/features/filesystem.js +++ b/ui (gen4)/features/filesystem.js @@ -593,11 +593,11 @@ var FileSystemWriterActions = actions.Actions({ // - horizontal // - ... 'export-preview-sizes': [ - 500, - 900, - 1000, - 1280, - 1920, + '500', + '900', + '1000', + '1280', + '1920', ], }, @@ -949,7 +949,7 @@ var FileSystemWriterActions = actions.Actions({ // get best preview... - var from = (img.base_path || base_dir) +'/'+ that.images.getBestPreview(gid, size).url + var from = decodeURI((img.base_path || base_dir) +'/'+ that.images.getBestPreview(gid, size).url) // XXX see if we need to make a preview (sharp) // XXX @@ -1245,7 +1245,10 @@ var FileSystemWriterUIActions = actions.Actions({ .on('open', widgets.makeNestedConfigListEditor(actions, overlay, 'export-preview-sizes', - 'export-preview-size')) + 'export-preview-size', + { + sort: function(a, b){ return parseInt(a) - parseInt(b) }, + })) }, // XXX BUG: history closing errors -- non-critical... @@ -1276,7 +1279,6 @@ var FileSystemWriterUIActions = actions.Actions({ 'export-paths', 'export-path', { - unique: true, new_button: false, })], ]}) @@ -1293,7 +1295,8 @@ var FileSystemWriterUIActions = actions.Actions({ }) .on('edit-done', function(_, path){ actions.config['export-path'] = path - actions.config['export-paths'].splice(0, 0, path) + actions.config['export-paths'].indexOf(path) < 0 + && actions.config['export-paths'].splice(0, 0, path) }) .on('edit-aborted edit-done', function(evt, path){ diff --git a/ui (gen4)/features/ui-widgets.js b/ui (gen4)/features/ui-widgets.js index 56171858..1f80a479 100755 --- a/ui (gen4)/features/ui-widgets.js +++ b/ui (gen4)/features/ui-widgets.js @@ -125,11 +125,14 @@ function(actions, list_key, options){ .push(txt) // unique... - if(options.unique == null || options.unique){ + if(options.unique == null || options.unique === true){ actions.config[list_key] = actions.config[list_key] - .unique(typeof(options.unique) == typeof(function(){}) ? - options.unique - : undefined) + .unique() + + // unique normalized... + } else if( typeof(options.unique) == typeof(function(){})){ + actions.config[list_key] = actions.config[list_key] + .unique(options.unique) } // sort... @@ -235,10 +238,11 @@ function(actions, list_key, options){ var makeNestedConfigListEditor = module.makeNestedConfigListEditor = function(actions, parent, list_key, value_key, options){ + options = options || {} + return function(){ var txt = $(this).find('.text').first().text() - options = options || {} var dfl_options = { new_button: 'New...', length_limit: 10,