mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-28 18:00:09 +00:00
now browse restores selection on .update() + some tweaking...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
41cf1c4216
commit
89741b9e95
@ -113,7 +113,16 @@ module.Location = core.ImageGridFeatures.Feature({
|
||||
['json',
|
||||
function(res){
|
||||
if(this.location){
|
||||
res.location = JSON.parse(JSON.stringify(this.location))
|
||||
var l = res.location = JSON.parse(JSON.stringify(this.location))
|
||||
|
||||
// cleanup base_path...
|
||||
Object.keys(res.images).forEach(function(gid){
|
||||
var img = res.images[gid]
|
||||
|
||||
if(l.path == img.base_path){
|
||||
delete img.base_path
|
||||
}
|
||||
})
|
||||
}
|
||||
}],
|
||||
['load',
|
||||
|
||||
@ -2026,7 +2026,7 @@ var ControlActions = actions.Actions({
|
||||
// silently focus central image...
|
||||
if(that.config['focus-central-image'] == 'silent'){
|
||||
that.data.focusImage(gid)
|
||||
that.ribbons.focusImage(a.current)
|
||||
that.ribbons.focusImage(that.current)
|
||||
|
||||
// focus central image in a normal manner...
|
||||
} else if(that.config['focus-central-image']){
|
||||
|
||||
@ -797,6 +797,13 @@ var BrowserPrototype = {
|
||||
path = this.path2list(path)
|
||||
var selection = path.pop()
|
||||
|
||||
// restore selection if path did not change...
|
||||
} else if(path instanceof Array
|
||||
&& path.length == this.path.length
|
||||
&& path.filter(function(e, i){ return e != this.path[i] }).length == 0){
|
||||
var selection = this.selected
|
||||
|
||||
// no selection...
|
||||
} else {
|
||||
path = this.path2list(path)
|
||||
var selection = null
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user