mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +00:00
a simplification of browse.open(..) ...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
4d6e889ca4
commit
9710770778
@ -1921,37 +1921,29 @@ var BrowserPrototype = {
|
|||||||
|
|
||||||
var elem = this.select('!')
|
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...
|
// normalize and load path...
|
||||||
//} else {
|
if(path && (path.constructor == Array || /[\\\/]/.test(path))){
|
||||||
} else if(path.constructor == Array || /[\\\/]/.test(path)) {
|
|
||||||
path = this.path2list(path)
|
path = this.path2list(path)
|
||||||
var elem = path.slice(-1)[0]
|
var elem = path.slice(-1)[0]
|
||||||
this.path = path.slice(0, -1)
|
this.path = path.slice(0, -1)
|
||||||
elem = this.select('"'+ elem +'"')
|
elem = this.select('"'+ elem +'"')
|
||||||
|
|
||||||
// select-compatible -- select from current context...
|
// get path + selection...
|
||||||
// XXX this is similar to the first branch, should we merge them???
|
|
||||||
} else {
|
} 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){
|
if(elem.length == 0){
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
path = this.path
|
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() +'"')
|
path.push('"'+ elem.find('.text').text() +'"')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user