mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-12-26 13:01:58 +00:00
some tweaking...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
9ab65ee8b6
commit
69b0cb25ee
@ -32,6 +32,12 @@
|
|||||||
.browse .path {
|
.browse .path {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
.browse .path:empty {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.browse .path:before {
|
||||||
|
content: "/";
|
||||||
|
}
|
||||||
.browse .path .dir {
|
.browse .path .dir {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
@ -75,6 +81,10 @@ var TREE = {
|
|||||||
},
|
},
|
||||||
file: 'this is a file',
|
file: 'this is a file',
|
||||||
}
|
}
|
||||||
|
// add some recursion for testing...
|
||||||
|
TREE.dir_d = TREE.dir_c.dir_b
|
||||||
|
TREE.dir_a.tree = TREE
|
||||||
|
TREE.dir_c.dir_b.tree = TREE
|
||||||
|
|
||||||
|
|
||||||
function skipFiles(e, v){
|
function skipFiles(e, v){
|
||||||
@ -172,6 +182,8 @@ function popDir(){
|
|||||||
var path = getPath(browser, this)
|
var path = getPath(browser, this)
|
||||||
|
|
||||||
showPath(browser, path, TREE)
|
showPath(browser, path, TREE)
|
||||||
|
|
||||||
|
select('"'+dir+'"')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -273,14 +285,28 @@ function prev(browser){
|
|||||||
return select('prev', browser)
|
return select('prev', browser)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// default action...
|
||||||
|
function action(browser){
|
||||||
|
browser = browser || $('.browse')
|
||||||
|
|
||||||
|
alert('/' + getPath(browser).concat(['']).join('/'))
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
var KB = {
|
var KB = {
|
||||||
'*':{
|
'*':{
|
||||||
F5: function(){ window.location.reload() },
|
F5: function(){ window.location.reload() },
|
||||||
|
},
|
||||||
|
'.browse':{
|
||||||
Up: prev,
|
Up: prev,
|
||||||
|
Backspace: 'Up',
|
||||||
Down: next,
|
Down: next,
|
||||||
Left: pop,
|
Left: pop,
|
||||||
Right: push,
|
Right: push,
|
||||||
|
|
||||||
|
Enter: action,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -294,9 +320,7 @@ requirejs(['../lib/keyboard'], function(m){
|
|||||||
.keydown(
|
.keydown(
|
||||||
keyboard.makeKeyboardHandler(
|
keyboard.makeKeyboardHandler(
|
||||||
KB,
|
KB,
|
||||||
function(k){
|
function(k){ window.DEBUG && console.log(k) }))
|
||||||
console.log(k)
|
|
||||||
}))
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -306,7 +330,6 @@ $(function(){
|
|||||||
.empty()
|
.empty()
|
||||||
.append(browser)
|
.append(browser)
|
||||||
showPath(browser, '/', TREE)
|
showPath(browser, '/', TREE)
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user