From 768f51b6225698798abc391b586327ed4d8ade2c Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Tue, 11 Jun 2013 04:46:45 +0400 Subject: [PATCH] minor bugfix... Signed-off-by: Alex A. Naanou --- ui/index.html | 7 ++++++- ui/keybindings.js | 12 ++++++------ ui/ui.js | 1 + 3 files changed, 13 insertions(+), 7 deletions(-) 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')