From 4c4217a5469d447da5e7403157e1f60937929e66 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 4 Jan 2017 05:15:56 +0300 Subject: [PATCH] fixed a bug in .saveIndex(..) + simplified pinning in history list... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/filesystem.js | 4 +++- ui (gen4)/features/history.js | 35 +++++++++++++++----------------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/ui (gen4)/features/filesystem.js b/ui (gen4)/features/filesystem.js index 60ba30a7..d03d6e69 100755 --- a/ui (gen4)/features/filesystem.js +++ b/ui (gen4)/features/filesystem.js @@ -1759,7 +1759,9 @@ var FileSystemWriterActions = actions.Actions({ logger = logger || this.logger 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 = util.normalizePath(path) diff --git a/ui (gen4)/features/history.js b/ui (gen4)/features/history.js index 9eac59d5..6a7bd91f 100755 --- a/ui (gen4)/features/history.js +++ b/ui (gen4)/features/history.js @@ -419,6 +419,17 @@ var URLHistoryUIActions = actions.Actions({ // - flase - never remove // - [ 'open', 'close' ] - explicitly select event '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. // a newly pinned item is added to the end of the pin list while @@ -523,9 +534,6 @@ var URLHistoryUIActions = actions.Actions({ +'', function(p){ 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... // pinned... @@ -539,23 +547,12 @@ var URLHistoryUIActions = actions.Actions({ that.toggleURLPinned(p, 'on') } + // focus... + that.config['url-history-focus-on-pin'] + && o.select(cur) + // place... - // special case: everything is pinned -- place last... - 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) - } + o.update() }], // mark for removal... ['×',