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;
}
.browse-widget:not(.flat) .path:not([contenteditable]):before {
content: "/";
content: attr(prefix);
}
.browse-widget .path .dir {
display: inline-block;

View File

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

View File

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