mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-28 18:00:09 +00:00
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 <alex.nanou@gmail.com>
This commit is contained in:
parent
07a6be21d5
commit
2e8150c5bb
@ -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)
|
||||
|
||||
@ -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...
|
||||
|
||||
@ -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) }
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user