minor refactoring and fixes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2018-03-26 01:10:32 +03:00
parent b5403e5542
commit 92c90fa466
3 changed files with 19 additions and 15 deletions

View File

@ -726,7 +726,7 @@ var CacheActions = actions.Actions({
// }) }],
//
cache: function(title, lister){
if(!this.config.cache){
if(!(this.config || {}).cache){
return lister.call(this)
}
var cache = this.__cache = this.__cache || {}

View File

@ -65,19 +65,18 @@ var StoreActions = actions.Actions({
// .stores_actions - dict of store-specific actions
get stores(){
return this.cache('stores', function(d){
var res = {}
this.actions.forEach(function(action){
return d ?
Object.assign({}, d)
: this.actions
.reduce(function(res, action){
var store = this.getActionAttr(action, 'handle_data_store')
res[store]
&& console.warn('Multiple handlers for store:', store)
if(store){
res[store] = action
}
}.bind(this))
return res
}) },
}.bind(this), {}) }) },
// events...
// XXX update signature -- see doc for: .loadStore(..)

View File

@ -1949,12 +1949,17 @@ var BrowseActionsActions = actions.Actions({
getKeys('browseActions!: "'+ p +'"'),
].filter(function(e){ return e.trim() != '' }).join(' / '),
},
// hide dirs containing only hidden stuff...
// XXX this will only check statically hidden stuff...
// ...the rest may still get dynamically hidden...
hidden: options.no_hidden ?
false
// hide dirs containing only (statically)
// hidden items...
// NOTE: we are not checking browseMode
// of other items actively here at
// this point to avoid side-effects...
: Object.keys(cur[key])
// XXX we still need to check browseMode of each child...
.filter(function(k){
return (cur[key][k] || [])[1] != 'hidden' })
.length == 0,