From 2e8150c5bb639893e37c17f6e3fcde50c61c5c19 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 22 May 2019 23:28:38 +0300 Subject: [PATCH] fixed a glob default change causing searches to fail on not being able to stat some abstract file in the tree... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/filesystem.js | 5 ++++- ui (gen4)/imagegrid/file.js | 6 +++--- ui (gen4)/lib/widget/browse2.js | 14 ++++++++++---- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/ui (gen4)/features/filesystem.js b/ui (gen4)/features/filesystem.js index 9d73e924..02640fbb 100755 --- a/ui (gen4)/features/filesystem.js +++ b/ui (gen4)/features/filesystem.js @@ -510,7 +510,10 @@ var FileSystemLoaderActions = actions.Actions({ // get the image list... return new Promise(function(resolve, reject){ - glob(path + '/'+ that.config['image-file-pattern'], {stat: !!read_stat}) + glob(path + '/'+ that.config['image-file-pattern'], { + stat: !!read_stat, + strict: false, + }) .on('error', function(err){ console.error(err) reject(err) diff --git a/ui (gen4)/imagegrid/file.js b/ui (gen4)/imagegrid/file.js index edcc5b77..80b369b8 100755 --- a/ui (gen4)/imagegrid/file.js +++ b/ui (gen4)/imagegrid/file.js @@ -103,7 +103,7 @@ module.gGlob = function(){ var listIndexes = module.listIndexes = function(base, index_dir){ - return gGlob(base +'/**/'+ (index_dir || INDEX_DIR)) + return gGlob(base +'/**/'+ (index_dir || INDEX_DIR), {strict: false}) } @@ -134,7 +134,7 @@ var listPreviews = module.listPreviews = function(base, img_pattern){ //return gGlob(base +'/*px/*jpg') - return gGlob(base +'/*px/'+(img_pattern || '*')+'.jpg') + return gGlob(base +'/*px/'+(img_pattern || '*')+'.jpg', {strict: false}) } @@ -144,7 +144,7 @@ module.listJSON = function(path, pattern){ pattern = pattern || '*' path = util.normalizePath(path) - return gGlob(path +'/'+ pattern +'.json') + return gGlob(path +'/'+ pattern +'.json', {strict: false}) } // wrap a node style callback function into a Promise... diff --git a/ui (gen4)/lib/widget/browse2.js b/ui (gen4)/lib/widget/browse2.js index c8fb437d..c7ed6c27 100755 --- a/ui (gen4)/lib/widget/browse2.js +++ b/ui (gen4)/lib/widget/browse2.js @@ -184,6 +184,10 @@ Items.ListTitle = function(){} //--------------------------------------------------------------------- +// Event system... +// +// XXX might be a good idea to make this a generic module... + // Generate an event method... // @@ -289,19 +293,21 @@ var makeItemEventMethod = function(event, handler, options){ // distinguish one from the other... { noQueryCheck: true }, options || {}) + // base event method... // NOTE: this is not returned directly as we need to query the items // and pass those on to the handlers rather than the arguments // as-is... - var method = makeEventMethod(event, + var base = makeEventMethod(event, function(evt, item, ...args){ handler && handler.call(this, evt, item.slice(), ...args) item.forEach(function(item){ callItemEventHandlers(item, event, evt, ...args) }) }) return Object.assign( + // the actual method we return... function(item, ...args){ var that = this - return method.call(this, + return base.call(this, // event handler... item instanceof Function ? item @@ -317,8 +323,8 @@ var makeItemEventMethod = function(event, handler, options){ this.search(item, options) : [], ...args) }, - // get method attributes -- keep the event method format... - method) } + // get base method attributes -- keep the event method format... + base) }