mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-11-01 03:40:09 +00:00
browser widget now feature complete, still needs refactoring...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
a620e60af5
commit
171cde55fb
@ -81,6 +81,18 @@
|
|||||||
.browse .path .dir:after {
|
.browse .path .dir:after {
|
||||||
content: "/";
|
content: "/";
|
||||||
}
|
}
|
||||||
|
.browse .path .dir.cur {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
.browse .path .dir.cur:after {
|
||||||
|
content: "";
|
||||||
|
}
|
||||||
|
.browse .path .dir.cur:hover {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
.browse .path .dir.cur:empty {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
/* XXX need to make this resizable up but only to a certain size (~80vh) */
|
/* XXX need to make this resizable up but only to a certain size (~80vh) */
|
||||||
/*
|
/*
|
||||||
.browse .list {
|
.browse .list {
|
||||||
|
|||||||
@ -80,7 +80,7 @@ var BrowserPrototype = {
|
|||||||
// XXX does the path includes the currently selected element?
|
// XXX does the path includes the currently selected element?
|
||||||
get path(){
|
get path(){
|
||||||
var skip = false
|
var skip = false
|
||||||
return this.dom.find('.path .dir')
|
return this.dom.find('.path .dir:not(.cur)')
|
||||||
.map(function(i, e){ return $(e).text() })
|
.map(function(i, e){ return $(e).text() })
|
||||||
.toArray()
|
.toArray()
|
||||||
},
|
},
|
||||||
@ -99,19 +99,36 @@ var BrowserPrototype = {
|
|||||||
var p = browser.find('.path').empty()
|
var p = browser.find('.path').empty()
|
||||||
var l = browser.find('.list').empty()
|
var l = browser.find('.list').empty()
|
||||||
|
|
||||||
|
var c = []
|
||||||
// fill the path field...
|
// fill the path field...
|
||||||
path.forEach(function(e){
|
path.forEach(function(e){
|
||||||
|
c.push(e)
|
||||||
|
var cur = c.slice()
|
||||||
p.append($('<div>')
|
p.append($('<div>')
|
||||||
.addClass('dir')
|
.addClass('dir')
|
||||||
.click(function(){ that.pop() })
|
.click(function(){
|
||||||
|
that
|
||||||
|
.update(cur.slice(0, -1))
|
||||||
|
.select('"'+cur.pop()+'"')
|
||||||
|
})
|
||||||
.text(e))
|
.text(e))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// add current selction indicator...
|
||||||
|
p.append($('<div>')
|
||||||
|
.addClass('dir cur')
|
||||||
|
.click(function(){
|
||||||
|
that
|
||||||
|
.update(path.concat($(this).text()))
|
||||||
|
}))
|
||||||
|
|
||||||
// fill the children list...
|
// fill the children list...
|
||||||
this.list(path)
|
this.list(path)
|
||||||
.forEach(function(e){
|
.forEach(function(e){
|
||||||
l.append($('<div>')
|
l.append($('<div>')
|
||||||
.click(function(){ that.push() })
|
.click(function(){
|
||||||
|
that.update(that.path.concat([$(this).text()]))
|
||||||
|
})
|
||||||
.text(e))
|
.text(e))
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -208,6 +225,7 @@ var BrowserPrototype = {
|
|||||||
// element...
|
// element...
|
||||||
} else {
|
} else {
|
||||||
this.select('none')
|
this.select('none')
|
||||||
|
browser.find('.path .dir.cur').text(elem.text())
|
||||||
return elem.addClass('selected')
|
return elem.addClass('selected')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -267,7 +285,7 @@ var BrowserPrototype = {
|
|||||||
|
|
||||||
focus: function(){
|
focus: function(){
|
||||||
this.dom.focus()
|
this.dom.focus()
|
||||||
return thsi
|
return this
|
||||||
},
|
},
|
||||||
|
|
||||||
// XXX think about the API...
|
// XXX think about the API...
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user