now browse restores selection on .update() + some tweaking...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-05-28 21:36:17 +03:00
parent 41cf1c4216
commit 89741b9e95
3 changed files with 18 additions and 2 deletions

View File

@ -113,7 +113,16 @@ module.Location = core.ImageGridFeatures.Feature({
['json', ['json',
function(res){ function(res){
if(this.location){ 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', ['load',

View File

@ -2026,7 +2026,7 @@ var ControlActions = actions.Actions({
// silently focus central image... // silently focus central image...
if(that.config['focus-central-image'] == 'silent'){ if(that.config['focus-central-image'] == 'silent'){
that.data.focusImage(gid) that.data.focusImage(gid)
that.ribbons.focusImage(a.current) that.ribbons.focusImage(that.current)
// focus central image in a normal manner... // focus central image in a normal manner...
} else if(that.config['focus-central-image']){ } else if(that.config['focus-central-image']){

View File

@ -797,6 +797,13 @@ var BrowserPrototype = {
path = this.path2list(path) path = this.path2list(path)
var selection = path.pop() 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 { } else {
path = this.path2list(path) path = this.path2list(path)
var selection = null var selection = null