mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-28 18:00:09 +00:00
tweaking and minor refactoring...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
89741b9e95
commit
11b9351e06
@ -130,14 +130,6 @@ var FileSystemLoaderActions = actions.Actions({
|
|||||||
'load-first-index-only': false,
|
'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???
|
// XXX should this be more general???
|
||||||
reloadState: ['File/Reload viewer state...',
|
reloadState: ['File/Reload viewer state...',
|
||||||
function(){
|
function(){
|
||||||
@ -328,6 +320,9 @@ var FileSystemLoaderActions = actions.Actions({
|
|||||||
})
|
})
|
||||||
*/
|
*/
|
||||||
.on('end', function(lst){
|
.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)
|
that.loadURLs(lst, path)
|
||||||
// XXX do we need to normalize paths after we get them from glob??
|
// XXX do we need to normalize paths after we get them from glob??
|
||||||
//that.loadURLs(lst.map(pathlib.posix.normalize), path)
|
//that.loadURLs(lst.map(pathlib.posix.normalize), path)
|
||||||
@ -456,10 +451,6 @@ var FileSystemLoaderActions = actions.Actions({
|
|||||||
logger && logger.emit('loaded', lst)
|
logger && logger.emit('loaded', lst)
|
||||||
})
|
})
|
||||||
}],
|
}],
|
||||||
|
|
||||||
clear: [function(){
|
|
||||||
delete this.__location
|
|
||||||
}],
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -110,6 +110,24 @@ module.Location = core.ImageGridFeatures.Feature({
|
|||||||
actions: LocationActions,
|
actions: LocationActions,
|
||||||
|
|
||||||
handlers: [
|
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',
|
['json',
|
||||||
function(res){
|
function(res){
|
||||||
if(this.location){
|
if(this.location){
|
||||||
|
|||||||
@ -333,7 +333,7 @@ module.ImagesClassPrototype = {
|
|||||||
ext: name[1],
|
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)){
|
if(base && base_pattern.test(path)){
|
||||||
images[gid].base_path = base
|
images[gid].base_path = base
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1084,7 +1084,8 @@ var BrowserPrototype = {
|
|||||||
|
|
||||||
// select the item...
|
// select the item...
|
||||||
if(selection){
|
if(selection){
|
||||||
that.select(selection)
|
//that.select(selection)
|
||||||
|
that.select('"'+ selection +'"')
|
||||||
}
|
}
|
||||||
|
|
||||||
// maintain focus within the widget...
|
// maintain focus within the widget...
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user