started fixing an issue with url-history not updating correctly when saving index...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-03-08 18:43:29 +03:00
parent 239d4a86d7
commit 128ba44778
5 changed files with 48 additions and 2 deletions

View File

@ -925,7 +925,7 @@ var FileSystemWriterUIActions = actions.Actions({
// XXX add ability to create dirs... // XXX add ability to create dirs...
browseSaveIndex: ['File/Save index to...', browseSaveIndex: ['File/Save index to...',
makeBrowseProxy('saveIndex', function(){ makeBrowseProxy('saveIndex', function(){
this.loaction.method = 'loadIndex' })], this.location.method = 'loadIndex' })],
}) })

View File

@ -336,6 +336,47 @@ module.URLHistoryLocalStorage = core.ImageGridFeatures.Feature({
}) })
// XXX
var URLHistoryFSWriter =
module.URLHistoryFSWriter = core.ImageGridFeatures.Feature({
title: '',
doc: '',
tag: 'url-history-fs-writer',
depends: [
'fs-writer',
'url-history-local-storage',
],
config: {
'url-history-push-to-top-on-save': false,
},
handlers: [
['saveIndex',
function(){
// push saved to top...
if(this.config['url-history-push-to-top-on-save']){
this.pushURLToHistory()
// update...
} else {
var l = this.location
var e = this.url_history[l.path]
if(e != null){
e.open = l.method
this.saveURLHistory()
} else {
this.pushURLToHistory()
}
}
}],
],
})
//--------------------------------------------------------------------- //---------------------------------------------------------------------
var URLHistoryUIActions = actions.Actions({ var URLHistoryUIActions = actions.Actions({

View File

@ -76,6 +76,7 @@ core.ImageGridFeatures.Feature('viewer-testing', [
'config-local-storage', 'config-local-storage',
'ui-url-hash', 'ui-url-hash',
'url-history-local-storage', 'url-history-local-storage',
'url-history-fs-writer',
'ui-single-image-view-local-storage', 'ui-single-image-view-local-storage',

View File

@ -348,7 +348,8 @@ module.StatusBar = core.ImageGridFeatures.Feature({
depends: [ depends: [
'ui', 'ui',
// XXX this is here to enable context menu... // XXX this is here to enable context menu
// see: StatusBarActions.__statusbar_elements__.mark(..)
'ui-browse-actions', 'ui-browse-actions',
], ],

View File

@ -34,5 +34,8 @@
"devDependencies": { "devDependencies": {
"nw-builder": "^2.2.0", "nw-builder": "^2.2.0",
"less": "*" "less": "*"
},
"scripts": {
"build-css": "lessc css/layout.less css/layout.css"
} }
} }