diff --git a/ui (gen4)/features/filesystem.js b/ui (gen4)/features/filesystem.js index d11aa837..9eb7bc2f 100755 --- a/ui (gen4)/features/filesystem.js +++ b/ui (gen4)/features/filesystem.js @@ -130,14 +130,6 @@ var FileSystemLoaderActions = actions.Actions({ 'load-first-index-only': false, }, - clone: [function(full){ - return function(res){ - if(this.location){ - res.__location = JSON.parse(JSON.stringify(this.__location)) - } - } - }], - // XXX should this be more general??? reloadState: ['File/Reload viewer state...', function(){ @@ -328,6 +320,9 @@ var FileSystemLoaderActions = actions.Actions({ }) */ .on('end', function(lst){ + // XXX might be a good idea to make image paths relative to path... + //lst = lst.map(function(p){ return pathlib.relative(base, p) }) + that.loadURLs(lst, path) // XXX do we need to normalize paths after we get them from glob?? //that.loadURLs(lst.map(pathlib.posix.normalize), path) @@ -456,10 +451,6 @@ var FileSystemLoaderActions = actions.Actions({ logger && logger.emit('loaded', lst) }) }], - - clear: [function(){ - delete this.__location - }], }) diff --git a/ui (gen4)/features/location.js b/ui (gen4)/features/location.js index fb80d9d3..9390a5cf 100755 --- a/ui (gen4)/features/location.js +++ b/ui (gen4)/features/location.js @@ -110,6 +110,24 @@ module.Location = core.ImageGridFeatures.Feature({ actions: LocationActions, handlers: [ + ['clone', + function(res){ + if(this.location){ + res.__location = JSON.parse(JSON.stringify(this.__location)) + } + }], + ['clear', + function(){ + delete this.__location + }], + + // 1) store .location + // 2) cleanup .images[..].base_path + // + // XXX might be good to make the .base_path relative to location + // if possible... + // XXX not sure if this is the right place for .images[..].base_path + // handling... ['json', function(res){ if(this.location){ diff --git a/ui (gen4)/images.js b/ui (gen4)/images.js index 76729c53..a03d3c45 100755 --- a/ui (gen4)/images.js +++ b/ui (gen4)/images.js @@ -333,7 +333,7 @@ module.ImagesClassPrototype = { ext: name[1], } - // remove only of base path is given and in path... + // remove only if base path is given and in path... if(base && base_pattern.test(path)){ images[gid].base_path = base } diff --git a/ui (gen4)/lib/widget/browse.js b/ui (gen4)/lib/widget/browse.js index 19b8c9ea..018e2849 100755 --- a/ui (gen4)/lib/widget/browse.js +++ b/ui (gen4)/lib/widget/browse.js @@ -1084,7 +1084,8 @@ var BrowserPrototype = { // select the item... if(selection){ - that.select(selection) + //that.select(selection) + that.select('"'+ selection +'"') } // maintain focus within the widget...