bugfix...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-02-08 22:59:16 +03:00
parent 1f38835e45
commit b4c7fe4499
2 changed files with 18 additions and 5 deletions

View File

@ -718,6 +718,7 @@ var URLHistoryUIActions = actions.Actions({
// be set to false on state update... // be set to false on state update...
var state_saved = false var state_saved = false
var to_sort = []
var to_remove = [] var to_remove = []
// cached fs state... // cached fs state...
var fs_state = {} var fs_state = {}
@ -748,7 +749,8 @@ var URLHistoryUIActions = actions.Actions({
to_remove = [] to_remove = []
// sort history... // sort history...
that.sortURLHistory(urls) //that.sortURLHistory(urls)
that.sortURLHistory(to_sort)
// toggle pins... // toggle pins...
pins pins
.concat(orig_pins || []) .concat(orig_pins || [])
@ -848,6 +850,9 @@ var URLHistoryUIActions = actions.Actions({
.on('close', function(){ .on('close', function(){
save() save()
}) })
.on('to_top_button', function(evt, p, e){
to_sort.splice(0, 0, p)
})
// handle 'O' button to browse path... // handle 'O' button to browse path...
dialog.browsePath = function(p){ dialog.browsePath = function(p){

View File

@ -745,13 +745,17 @@ function(list, options){
move(p, -1) move(p, -1)
&& e.prev().before(e) && e.prev().before(e)
// XXX hackish... // XXX hackish...
&& dialog.updateItemNumbers() }], && dialog
.updateItemNumbers()
.trigger('up_button', p, e) }],
DOWN: [options.shift_down_button || '&#9207;', DOWN: [options.shift_down_button || '&#9207;',
function(p, e){ function(p, e){
move(p, 1) move(p, 1)
&& e.next().after(e) && e.next().after(e)
// XXX hackish... // XXX hackish...
&& dialog.updateItemNumbers() }], && dialog
.updateItemNumbers()
.trigger('down_button', p, e) }],
TO_TOP: [ TO_TOP: [
(options.to_top_button === true (options.to_top_button === true
|| buttons.indexOf('TO_TOP') >= 0) ? || buttons.indexOf('TO_TOP') >= 0) ?
@ -762,7 +766,9 @@ function(list, options){
d d
&& e.prevAll().eq(Math.abs(d+1)).before(e) && e.prevAll().eq(Math.abs(d+1)).before(e)
// XXX hackish... // XXX hackish...
&& dialog.updateItemNumbers() && dialog
.updateItemNumbers()
.trigger('to_top_button', p, e)
}], }],
TO_BOTTOM: [ TO_BOTTOM: [
(options.to_bottom_button === true (options.to_bottom_button === true
@ -774,7 +780,9 @@ function(list, options){
d d
&& e.nextAll().eq(Math.abs(d-1)).after(e) && e.nextAll().eq(Math.abs(d-1)).after(e)
// XXX hackish... // XXX hackish...
&& dialog.updateItemNumbers() && dialog
.updateItemNumbers()
.trigger('to_bottom_button', p, e)
}], }],
REMOVE: Buttons.markForRemoval( REMOVE: Buttons.markForRemoval(
to_remove, to_remove,