From c73dd6265a72753ccdbb1a526900dc9c3382888e Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 13 Jun 2019 03:05:44 +0300 Subject: [PATCH] notes and docs... Signed-off-by: Alex A. Naanou --- ui (gen4)/lib/widget/browse2.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ui (gen4)/lib/widget/browse2.js b/ui (gen4)/lib/widget/browse2.js index b571a407..f5e80599 100755 --- a/ui (gen4)/lib/widget/browse2.js +++ b/ui (gen4)/lib/widget/browse2.js @@ -1606,7 +1606,7 @@ var BaseBrowserPrototype = { // NOTE: a non-path array is one where at least one element is // an object... // 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)) if(index.has(pattern) || (pattern instanceof Array @@ -1631,7 +1631,8 @@ var BaseBrowserPrototype = { [ func ? func.call(this, pattern, ...index.get(pattern), - function(v){ + // stop(..) + function stop(v){ res = v throw Stop }) : pattern ] @@ -2693,7 +2694,6 @@ var BaseBrowserPrototype = { { skipDisabled: false }), // primary/secondary/ternary? item actions... - // XXX revise default actions... open: makeItemEventMethod('open', function(evt, item){}, // XXX not yet sure if this is correct... @@ -2735,7 +2735,8 @@ var BaseBrowserPrototype = { full && this.make(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', function(evt, target){}, function(evt, target){ @@ -2745,13 +2746,11 @@ var BaseBrowserPrototype = { target.trim() + '*' : target.trim()).split(/[\\\/]/g) : target - + // search for longest existing path... var elem do{ elem = this.get(target) } while(elem === undefined && target.pop()) - - elem && this.focus(elem) }),