refactoring: split fs actions into generic and ui + fixed path prefix CSS presentation...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2015-11-29 03:42:55 +03:00
parent b82a168292
commit d0de6fbe9d
3 changed files with 35 additions and 17 deletions

View File

@ -61,7 +61,7 @@
display: block; display: block;
} }
.browse-widget:not(.flat) .path:not([contenteditable]):before { .browse-widget:not(.flat) .path:not([contenteditable]):before {
content: "/"; content: attr(prefix);
} }
.browse-widget .path .dir { .browse-widget .path .dir {
display: inline-block; display: inline-block;

View File

@ -128,6 +128,9 @@ var BrowserClassPrototype = {
}) })
*/ */
if(options.pathPrefix){
path.attr('prefix', options.pathPrefix)
}
if(options.show_path == false){ if(options.show_path == false){
path.hide() path.hide()
} }
@ -557,6 +560,9 @@ var BrowserPrototype = {
var p = browser.find('.path').empty() var p = browser.find('.path').empty()
var l = browser.find('.list').empty() var l = browser.find('.list').empty()
// set the path prefix...
p.attr('prefix', this.options.pathPrefix)
var c = [] var c = []
// fill the path field... // fill the path field...
path.forEach(function(e){ path.forEach(function(e){
@ -2096,6 +2102,7 @@ module.makePathList = function(elem, list, path){
} }
/********************************************************************** /**********************************************************************
* vim:set ts=4 sw=4 : */ * vim:set ts=4 sw=4 : */
return module }) return module })

View File

@ -3283,13 +3283,28 @@ var FileSystemLoaderActions = actions.Actions({
that.load(index) that.load(index)
}) })
}], }],
})
// XXX move this to the UI version of this feature...
// ...and make the UI version of .loadPath(..) run this if no var FileSystemLoader =
// path was given... module.FileSystemLoader = ImageGridFeatures.Feature({
// XXX STUB: this dances around an issue in the browser -- removing title: '',
// the leading '/' on windows... doc: '',
// ...fix in Browse(..) / Walk(..)
tag: 'fs-loader',
actions: FileSystemLoaderActions,
isApplicable: function(){
return window.nodejs != null
},
})
//---------------------------------------------------------------------
var FileSystemLoaderUIActions = actions.Actions({
// XXX BUG: for some reason this when run from .browseActions(..) loads // XXX BUG: for some reason this when run from .browseActions(..) loads
// incorrectly while when called directly is OK... // incorrectly while when called directly is OK...
browsePath: ['File/Browse file system...', browsePath: ['File/Browse file system...',
@ -3308,8 +3323,6 @@ var FileSystemLoaderActions = actions.Actions({
&& parent.close && parent.close
&& parent.close() && parent.close()
console.log('PATH:', path)
// pass the selected path on... // pass the selected path on...
if(callback){ if(callback){
callback(path) callback(path)
@ -3328,18 +3341,15 @@ var FileSystemLoaderActions = actions.Actions({
}) })
var FileSystemLoader = var FileSystemLoaderUI =
module.FileSystemLoader = ImageGridFeatures.Feature({ module.FileSystemLoaderUI = ImageGridFeatures.Feature({
title: '', title: '',
doc: '', doc: '',
tag: 'fs-loader', tag: 'fs-loader-ui',
depends: ['fs-loader'],
actions: FileSystemLoaderActions, actions: FileSystemLoaderUIActions,
isApplicable: function(){
return window.nodejs != null
},
}) })
@ -3368,6 +3378,7 @@ ImageGridFeatures.Feature('viewer-testing', [
'image-bookmarks', 'image-bookmarks',
'fs-loader', 'fs-loader',
'fs-loader-ui',
'app-control', 'app-control',
// chrome... // chrome...