diff --git a/ui/index.html b/ui/index.html index 053f2ebb..48fdc901 100755 --- a/ui/index.html +++ b/ui/index.html @@ -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)) diff --git a/ui/keybindings.js b/ui/keybindings.js index 5e2a0158..7968f946 100755 --- a/ui/keybindings.js +++ b/ui/keybindings.js @@ -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)) + }) }), diff --git a/ui/ui.js b/ui/ui.js index ce335e98..9980c6a4 100755 --- a/ui/ui.js +++ b/ui/ui.js @@ -418,6 +418,7 @@ function prompt(message, dfl, btn){ form.find('button') .click(function(){ overlay.trigger('accept') + hideOverlay(root) }) var input = form.find('input')