From 0aeb494a6b62f7b337ce50cbe4798f8f8ffc9ef9 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 30 Jan 2017 23:32:08 +0300 Subject: [PATCH] some tweaking... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/filesystem.js | 4 ++-- ui (gen4)/features/metadata.js | 20 ++++++++++++-------- ui (gen4)/features/ui.js | 10 +++++++++- ui (gen4)/lib/widget/browse.js | 4 ++-- 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/ui (gen4)/features/filesystem.js b/ui (gen4)/features/filesystem.js index 2f1d7c94..c00ca7ad 100755 --- a/ui (gen4)/features/filesystem.js +++ b/ui (gen4)/features/filesystem.js @@ -2538,7 +2538,7 @@ var FileSystemWriterUIActions = actions.Actions({ var data = that.config['export-dialog-modes'][mode].data // mode selector... - make(['Export mode: ', + make(['Export $mode: ', function(){ return mode }]) .on('open', widgets.makeNestedConfigListEditor(that, o, @@ -2564,7 +2564,7 @@ var FileSystemWriterUIActions = actions.Actions({ // Start action... make([function(){ // XXX indicate export state: index, crop, image... - return 'Export'}]) + return '$Export'}]) .on('open', function(){ var mode = that.config['export-dialog-modes'][that.config['export-dialog-mode']] diff --git a/ui (gen4)/features/metadata.js b/ui (gen4)/features/metadata.js index 67c5a192..ff9ed460 100755 --- a/ui (gen4)/features/metadata.js +++ b/ui (gen4)/features/metadata.js @@ -343,9 +343,13 @@ var MetadataUIActions = actions.Actions({ // helpers... var _cmp = function(a, b){ - a = field_order.indexOf(a[0].replace(/^- |: $/g, '')) + a = field_order.indexOf(a[0] + .replace(/\$(\w)/g, '$1') + .replace(/^- |: $/g, '')) a = a == -1 ? x : a - b = field_order.indexOf(b[0].replace(/^- |: $/g, '')) + b = field_order.indexOf(b[0] + .replace(/\$(\w)/g, '$1') + .replace(/^- |: $/g, '')) b = b == -1 ? x : b return a - b } @@ -354,7 +358,7 @@ var MetadataUIActions = actions.Actions({ // XXX move these to an info feature... // base fields... var base = [ - ['GID: ', image], + ['$GID: ', image], // NOTE: these are 1-based and not 0-based... ['Index (ribbon): ', that.data.getImageOrder('ribbon', image) + 1 @@ -393,11 +397,11 @@ var MetadataUIActions = actions.Actions({ // paths... img.path - && base.push(['File Name: ', + && base.push(['File $Name: ', _basename(img.path)]) - && base.push(['Parent Directory: ', + && base.push(['Parent $Directory: ', _dirname((img.base_path || '.') +'/'+ img.path)]) - && base.push(['Full Path: ', + && base.push(['Full $Path: ', _normalize((img.base_path || '.') +'/'+ img.path)]) // times... @@ -416,10 +420,10 @@ var MetadataUIActions = actions.Actions({ } // comment and tags... - info.push(['Comment: ', + info.push(['$Comment: ', function(){ return img && img.comment || '' }]) - info.push(['Tags: ', + info.push(['$Tags: ', function(){ return that.data.getTags().join(', ') || '' }]) // build fields... diff --git a/ui (gen4)/features/ui.js b/ui (gen4)/features/ui.js index 29d6ca2c..3d15f6ef 100755 --- a/ui (gen4)/features/ui.js +++ b/ui (gen4)/features/ui.js @@ -2249,6 +2249,8 @@ var ControlActions = actions.Actions({ }], + // XXX make the enable handling check a bit more general... + // ...allow ui features to control this... toggleSwipeHandling: ['Interface/Swipe handling', toggler.Toggler(null, function(_, state){ @@ -2272,7 +2274,13 @@ var ControlActions = actions.Actions({ viewer.data('hammer') .get('swipe') - .set({direction: Hammer.DIRECTION_ALL}) + .set({ + direction: Hammer.DIRECTION_ALL, + // do not handle swipes when a modal + // dialog is open... + // XXX make this more general... + enable: function(){ return !that.modal }, + }) if(!viewer.hasClass('swipable')){ viewer diff --git a/ui (gen4)/lib/widget/browse.js b/ui (gen4)/lib/widget/browse.js index 8c0dacc3..6f846936 100755 --- a/ui (gen4)/lib/widget/browse.js +++ b/ui (gen4)/lib/widget/browse.js @@ -371,7 +371,7 @@ function(text, options){ // skipDisabledItems: false, // // // if true, group the items into a element... -// groupList: true, +// groupList: false, // // // see: make(..) for additional option info. // ... @@ -420,7 +420,7 @@ function(data, options){ res.push(elem[0]) }) - options.groupList !== false + options.groupList && $(res).parent() .append($('
') .addClass('item-group')