mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +00:00
fixed a bug in .saveIndex(..) + simplified pinning in history list...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
88071a29c3
commit
4c4217a546
@ -1759,7 +1759,9 @@ var FileSystemWriterActions = actions.Actions({
|
|||||||
logger = logger || this.logger
|
logger = logger || this.logger
|
||||||
logger = logger && logger.push('Save')
|
logger = logger && logger.push('Save')
|
||||||
|
|
||||||
path = path || this.location.loaded
|
path = path
|
||||||
|
|| this.location.loaded
|
||||||
|
|| this.location.path
|
||||||
path = path && path.length == 1 ? path[0] : path
|
path = path && path.length == 1 ? path[0] : path
|
||||||
path = util.normalizePath(path)
|
path = util.normalizePath(path)
|
||||||
|
|
||||||
|
|||||||
@ -419,6 +419,17 @@ var URLHistoryUIActions = actions.Actions({
|
|||||||
// - flase - never remove
|
// - flase - never remove
|
||||||
// - [ 'open', 'close' ] - explicitly select event
|
// - [ 'open', 'close' ] - explicitly select event
|
||||||
'url-history-list-clear': ['open', 'close'],
|
'url-history-list-clear': ['open', 'close'],
|
||||||
|
|
||||||
|
// If true pushing the pin item button will also focus the item
|
||||||
|
//
|
||||||
|
// NOTE: Both settings have their pluses and minuses:
|
||||||
|
// enabled (true)
|
||||||
|
// + will keep the item on screen
|
||||||
|
// - will lose context
|
||||||
|
// disabled (false)
|
||||||
|
// + will keep context
|
||||||
|
// - will lose the item from view if list is long
|
||||||
|
'url-history-focus-on-pin': false,
|
||||||
},
|
},
|
||||||
// XXX pinned items are sorted differently on load and on pin -- i.e.
|
// XXX pinned items are sorted differently on load and on pin -- i.e.
|
||||||
// a newly pinned item is added to the end of the pin list while
|
// a newly pinned item is added to the end of the pin list while
|
||||||
@ -523,9 +534,6 @@ var URLHistoryUIActions = actions.Actions({
|
|||||||
+'<span class="pin-unset">○</span>',
|
+'<span class="pin-unset">○</span>',
|
||||||
function(p){
|
function(p){
|
||||||
var cur = this.filter('"'+p+'"', false)
|
var cur = this.filter('"'+p+'"', false)
|
||||||
var top_unpinned = this.filter('*', false)
|
|
||||||
.filter(':not(.pinned)').first()
|
|
||||||
var sep = this.dom.find('.list>.pinned-separator')
|
|
||||||
|
|
||||||
// change state...
|
// change state...
|
||||||
// pinned...
|
// pinned...
|
||||||
@ -539,23 +547,12 @@ var URLHistoryUIActions = actions.Actions({
|
|||||||
that.toggleURLPinned(p, 'on')
|
that.toggleURLPinned(p, 'on')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// focus...
|
||||||
|
that.config['url-history-focus-on-pin']
|
||||||
|
&& o.select(cur)
|
||||||
|
|
||||||
// place...
|
// place...
|
||||||
// special case: everything is pinned -- place last...
|
o.update()
|
||||||
if(top_unpinned.length == 0){
|
|
||||||
this.filter('*', false).last()
|
|
||||||
.after(cur)
|
|
||||||
.after(sep)
|
|
||||||
|
|
||||||
// place after last pinned...
|
|
||||||
} else {
|
|
||||||
top_unpinned
|
|
||||||
.before(cur)
|
|
||||||
|
|
||||||
// place the separator...
|
|
||||||
cur.hasClass('pinned') ?
|
|
||||||
cur.after(sep)
|
|
||||||
: cur.before(sep)
|
|
||||||
}
|
|
||||||
}],
|
}],
|
||||||
// mark for removal...
|
// mark for removal...
|
||||||
['×',
|
['×',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user