notes and docs...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2019-06-13 03:05:44 +03:00
parent cebfe2be47
commit c73dd6265a

View File

@ -1606,7 +1606,7 @@ var BaseBrowserPrototype = {
// NOTE: a non-path array is one where at least one element is // NOTE: a non-path array is one where at least one element is
// an object... // an object...
// NOTE: this might get expensive as we call .search(..) per item... // NOTE: this might get expensive as we call .search(..) per item...
// XXX needs refactoring... // XXX needs refactoring -- feels overcomplicated...
var index = new Set(Object.values(this.index)) var index = new Set(Object.values(this.index))
if(index.has(pattern) if(index.has(pattern)
|| (pattern instanceof Array || (pattern instanceof Array
@ -1631,7 +1631,8 @@ var BaseBrowserPrototype = {
[ func ? [ func ?
func.call(this, pattern, func.call(this, pattern,
...index.get(pattern), ...index.get(pattern),
function(v){ // stop(..)
function stop(v){
res = v res = v
throw Stop }) throw Stop })
: pattern ] : pattern ]
@ -2693,7 +2694,6 @@ var BaseBrowserPrototype = {
{ skipDisabled: false }), { skipDisabled: false }),
// primary/secondary/ternary? item actions... // primary/secondary/ternary? item actions...
// XXX revise default actions...
open: makeItemEventMethod('open', open: makeItemEventMethod('open',
function(evt, item){}, function(evt, item){},
// XXX not yet sure if this is correct... // XXX not yet sure if this is correct...
@ -2735,7 +2735,8 @@ var BaseBrowserPrototype = {
full && this.make(options) }) full && this.make(options) })
.render(options) }), .render(options) }),
// XXX load longest existing sub-path... // NOTE: if given a path that does not exist this will try and load
// the longest existing sub-path...
load: makeEventMethod('load', load: makeEventMethod('load',
function(evt, target){}, function(evt, target){},
function(evt, target){ function(evt, target){
@ -2745,13 +2746,11 @@ var BaseBrowserPrototype = {
target.trim() + '*' target.trim() + '*'
: target.trim()).split(/[\\\/]/g) : target.trim()).split(/[\\\/]/g)
: target : target
// search for longest existing path...
var elem var elem
do{ do{
elem = this.get(target) elem = this.get(target)
} while(elem === undefined && target.pop()) } while(elem === undefined && target.pop())
elem elem
&& this.focus(elem) }), && this.focus(elem) }),