minor bugfix...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-06-11 04:46:45 +04:00
parent 5fb722d036
commit 768f51b622
3 changed files with 13 additions and 7 deletions

View File

@ -221,9 +221,14 @@ $(function(){
})
*/
console.log(localStorage[DATA_ATTR + '_BASE_URL'])
// we have an image file...
if((DATA_ATTR + '_BASE_URL') in localStorage
&& !/.[\/\\]*/.test(localStorage[DATA_ATTR + '_BASE_URL'])){
&& !/^\.[\/\\]*/.test(localStorage[DATA_ATTR + '_BASE_URL'])){
BASE_URL = localStorage[DATA_ATTR + '_BASE_URL']
var loading = statusNotify(loadDir(BASE_URL))

View File

@ -77,6 +77,7 @@ var KEYBOARD_CONFIG = {
Enter: doc('Accept dialog',
function(){
getOverlay($('.viewer')).trigger('accept')
hideOverlay($('.viewer'))
}),
Esc: doc('Close dialog',
function(){
@ -276,12 +277,11 @@ var KEYBOARD_CONFIG = {
// XXX STUB: use a real path browser...
O: doc('Open a directory path',
function(){
var path = prompt('Path to open', BASE_URL)
if(path == null){
return
}
path = path.trim()
statusNotify(loadDir(path))
prompt('Path to open', BASE_URL)
.done(function(path){
path = path.trim()
statusNotify(loadDir(path))
})
}),

View File

@ -418,6 +418,7 @@ function prompt(message, dfl, btn){
form.find('button')
.click(function(){
overlay.trigger('accept')
hideOverlay(root)
})
var input = form.find('input')