diff --git a/ui (gen4)/features/history.js b/ui (gen4)/features/history.js index ea00a5d6..8b88b113 100755 --- a/ui (gen4)/features/history.js +++ b/ui (gen4)/features/history.js @@ -718,6 +718,7 @@ var URLHistoryUIActions = actions.Actions({ // be set to false on state update... var state_saved = false + var to_sort = [] var to_remove = [] // cached fs state... var fs_state = {} @@ -748,7 +749,8 @@ var URLHistoryUIActions = actions.Actions({ to_remove = [] // sort history... - that.sortURLHistory(urls) + //that.sortURLHistory(urls) + that.sortURLHistory(to_sort) // toggle pins... pins .concat(orig_pins || []) @@ -848,6 +850,9 @@ var URLHistoryUIActions = actions.Actions({ .on('close', function(){ save() }) + .on('to_top_button', function(evt, p, e){ + to_sort.splice(0, 0, p) + }) // handle 'O' button to browse path... dialog.browsePath = function(p){ diff --git a/ui (gen4)/lib/widget/browse.js b/ui (gen4)/lib/widget/browse.js index a50698df..adce4772 100755 --- a/ui (gen4)/lib/widget/browse.js +++ b/ui (gen4)/lib/widget/browse.js @@ -745,13 +745,17 @@ function(list, options){ move(p, -1) && e.prev().before(e) // XXX hackish... - && dialog.updateItemNumbers() }], + && dialog + .updateItemNumbers() + .trigger('up_button', p, e) }], DOWN: [options.shift_down_button || '⏷', function(p, e){ move(p, 1) && e.next().after(e) // XXX hackish... - && dialog.updateItemNumbers() }], + && dialog + .updateItemNumbers() + .trigger('down_button', p, e) }], TO_TOP: [ (options.to_top_button === true || buttons.indexOf('TO_TOP') >= 0) ? @@ -762,7 +766,9 @@ function(list, options){ d && e.prevAll().eq(Math.abs(d+1)).before(e) // XXX hackish... - && dialog.updateItemNumbers() + && dialog + .updateItemNumbers() + .trigger('to_top_button', p, e) }], TO_BOTTOM: [ (options.to_bottom_button === true @@ -774,7 +780,9 @@ function(list, options){ d && e.nextAll().eq(Math.abs(d-1)).after(e) // XXX hackish... - && dialog.updateItemNumbers() + && dialog + .updateItemNumbers() + .trigger('to_bottom_button', p, e) }], REMOVE: Buttons.markForRemoval( to_remove,