From 47a56706bc0d002173e7cd629d63aa7ad2250d83 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sat, 11 Jul 2020 18:21:06 +0300 Subject: [PATCH] minor refactoring... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/demo.js | 5 ++--- ui (gen4)/imagegrid/file.js | 13 ++++--------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/ui (gen4)/features/demo.js b/ui (gen4)/features/demo.js index 3442305c..6844eb02 100755 --- a/ui (gen4)/features/demo.js +++ b/ui (gen4)/features/demo.js @@ -96,6 +96,7 @@ module.Demo = core.ImageGridFeatures.Feature({ actions: actions.Actions({ loadDemoIndex: ['File/Load demo data', + {mode: 'advancedBrowseModeAction'}, function(){ this.load({ data: data.Data(demo_data), @@ -107,9 +108,7 @@ module.Demo = core.ImageGridFeatures.Feature({ load: 'loadDemoIndex', sync: 'loadDemoIndex', check: true, - } - }) - }], + } }) }], }) }) diff --git a/ui (gen4)/imagegrid/file.js b/ui (gen4)/imagegrid/file.js index c8f07893..48de0d84 100755 --- a/ui (gen4)/imagegrid/file.js +++ b/ui (gen4)/imagegrid/file.js @@ -103,8 +103,7 @@ module.gGlob = function(){ var listIndexes = module.listIndexes = function(base, index_dir){ - return gGlob(base +'/**/'+ (index_dir || INDEX_DIR), {strict: false}) -} + return gGlob(base +'/**/'+ (index_dir || INDEX_DIR), {strict: false}) } // NOTE: this is similar to listIndexes(..) but will return a promise and @@ -125,17 +124,14 @@ function(base, index_dir, logger){ .on('end', function(paths){ // skip nested indexes... resolve(skipNested(paths, index_dir, logger)) - }) - }) -} + }) }) } var listPreviews = module.listPreviews = function(base, img_pattern){ //return gGlob(base +'/*px/*jpg') - return gGlob(base +'/*px/'+(img_pattern || '*')+'.jpg', {strict: false}) -} + return gGlob(base +'/*px/'+(img_pattern || '*')+'.jpg', {strict: false}) } // XXX return a promise rather than an event emitter (???) @@ -144,8 +140,7 @@ module.listJSON = function(path, pattern){ pattern = pattern || '*' path = util.normalizePath(path) - return gGlob(path +'/'+ pattern +'.json', {strict: false}) -} + return gGlob(path +'/'+ pattern +'.json', {strict: false}) } // wrap a node style callback function into a Promise... //