From 9710770778d0cc9f7a6a62c6a5cdab823a15592b Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 10 Feb 2016 20:31:48 +0300 Subject: [PATCH] a simplification of browse.open(..) ... Signed-off-by: Alex A. Naanou --- ui (gen4)/lib/widget/browse.js | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/ui (gen4)/lib/widget/browse.js b/ui (gen4)/lib/widget/browse.js index 5524673d..73972722 100755 --- a/ui (gen4)/lib/widget/browse.js +++ b/ui (gen4)/lib/widget/browse.js @@ -1921,37 +1921,29 @@ var BrowserPrototype = { var elem = this.select('!') - // get path + selection... - if(!path){ - // nothing selected, select first and exit... - if(elem.length == 0){ - //this.select() - return this - } - - // load the current path + selection... - path = this.path - path.push('"'+ elem.find('.text').text() +'"') - // normalize and load path... - //} else { - } else if(path.constructor == Array || /[\\\/]/.test(path)) { + if(path && (path.constructor == Array || /[\\\/]/.test(path))){ path = this.path2list(path) var elem = path.slice(-1)[0] this.path = path.slice(0, -1) elem = this.select('"'+ elem +'"') - // select-compatible -- select from current context... - // XXX this is similar to the first branch, should we merge them??? + // get path + selection... } else { - elem = this.select(path) + // select-compatible -- select from current context... + if(!path){ + // NOTE: this is select compatible thus no need to quote + // anything here... + elem = this.select(path) + } if(elem.length == 0){ return this } path = this.path - //path.push(quoteWS(elem.find('.text').text())) + // NOTE: we are quoting here to get a explicit element + // selected from list... path.push('"'+ elem.find('.text').text() +'"') }