some cleanup + docs...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2015-11-29 21:25:30 +03:00
parent 6b8b4d2801
commit b8968ce69f
2 changed files with 15 additions and 7 deletions

View File

@ -233,7 +233,6 @@ module.makeWalk = function(elem, path, showNonTraversable, showDisabled){
WalkPrototype.options.showDisabled WalkPrototype.options.showDisabled
: showDisabled, : showDisabled,
}) })
console.log(w)
return w return w
} }

View File

@ -162,7 +162,6 @@ module.ImageGridFeatures = Object.create(features.FeatureSet)
var BaseActions = var BaseActions =
module.BaseActions = module.BaseActions =
actions.Actions({ actions.Actions({
config: { config: {
// see .direction for details... // see .direction for details...
'steps-to-change-direction': 3, 'steps-to-change-direction': 3,
@ -1852,6 +1851,7 @@ module.PartialRibbons = ImageGridFeatures.Feature({
var SingleImageActions = actions.Actions({ var SingleImageActions = actions.Actions({
config: { config: {
// NOTE: these will get overwritten if/when the user changes the scale...
'single-image-scale': null, 'single-image-scale': null,
'ribbon-scale': null, 'ribbon-scale': null,
}, },
@ -2895,6 +2895,7 @@ module.AutoSingleImage = ImageGridFeatures.Feature({
tag: 'auto-single-image', tag: 'auto-single-image',
// NOTE: this feature has no actions defined but needs the config...
config: { config: {
'auto-single-image-in': 2, 'auto-single-image-in': 2,
'auto-single-image-out': 7, 'auto-single-image-out': 7,
@ -3344,6 +3345,11 @@ var makeProwseProxy = function(action){
var FileSystemLoaderUIActions = actions.Actions({ var FileSystemLoaderUIActions = actions.Actions({
config: { config: {
// list of loaders to complete .browsePath(..) action
//
// NOTE: these will be displayed in the same order as they appear
// in the list.
// NOTE: the first one is auto-selected.
'path-loaders': [ 'path-loaders': [
'loadIndex', 'loadIndex',
'loadImages', 'loadImages',
@ -3357,14 +3363,14 @@ var FileSystemLoaderUIActions = actions.Actions({
// to start from. // to start from.
// XXX should passing no path to this start browsing from the current // XXX should passing no path to this start browsing from the current
// path or from the root? // path or from the root?
loadIndex: ['File/Load index...', loadIndex: [makeProwseProxy('loadIndex')],
makeProwseProxy('loadIndex')], loadImages: [makeProwseProxy('loadImages')],
loadImages: ['File/Load images...',
makeProwseProxy('loadImages')],
// XXX BUG: for some reason this when run from .browseActions(..) or // XXX BUG: for some reason this when run from .browseActions(..) or
// any other Browse, loads incorrectly while when called // any other Browse, loads incorrectly while when called
// directly is OK... // directly is OK...
// XXX for some reason the path list blinks (.update()???) when sub
// menu is shown...
// XXX should the loader list be nested or open in overlay (as-is now)??? // XXX should the loader list be nested or open in overlay (as-is now)???
browsePath: ['File/Browse file system...', browsePath: ['File/Browse file system...',
function(base, callback){ function(base, callback){
@ -3376,6 +3382,7 @@ var FileSystemLoaderUIActions = actions.Actions({
require('./lib/widget/browse-walk').makeWalk(null, base, false, false) require('./lib/widget/browse-walk').makeWalk(null, base, false, false)
// path selected... // path selected...
.open(function(evt, path){ .open(function(evt, path){
var item = o.client.selected
// single loader... // single loader...
if(callback && callback.constructor === Function){ if(callback && callback.constructor === Function){
@ -3397,7 +3404,7 @@ var FileSystemLoaderUIActions = actions.Actions({
} else { } else {
var loaders = {} var loaders = {}
that.config['path-loaders'].forEach(function(m){ that.config['path-loaders'].forEach(function(m){
loaders[that[m].doc.split('/').pop()] = function(){ loaders[that.getDoc(m)[m][0].split('/').pop()] = function(){
return that[m](path) return that[m](path)
} }
}) })
@ -3414,7 +3421,9 @@ var FileSystemLoaderUIActions = actions.Actions({
// closed menu... // closed menu...
.close(function(){ .close(function(){
o.focus() o.focus()
o.client.select(item)
}) })
// select top element...
so.client.select(0) so.client.select(0)
} }
})) }))