diff --git a/public/dragreg.js b/public/dragreg.js index 70b44c7..e42229c 100644 --- a/public/dragreg.js +++ b/public/dragreg.js @@ -47,6 +47,9 @@ function key_handler(e) { case 27: /* Escape */ hide_add_dialog(); break; + case 187: /* Plus */ + show_add_dialog(); + break; } } @@ -54,14 +57,18 @@ function key_handler(e) { // Shows the upload/add dialog. function show_add_dialog() { - $('text').clear(); - $('add_dialog').appear({duration: 0.25}); + if (!$('add_dialog').visible()) { + $('text').clear(); + $('add_dialog').appear({duration: 0.25}); + } } // Hides and clears the upload/add dialog. function hide_add_dialog() { - $('add_dialog').fade({duration: 0.25}); - $('add_form').reset(); + if ($('add_dialog').visible()) { + $('add_dialog').fade({duration: 0.25}); + $('add_form').reset(); + } } // Returns a Z-index higher with respect to the Z-index of all existing