Added support for the Plus key (shows the add/upload dialog).

This commit is contained in:
Paul van Tilburg 2010-09-12 12:36:20 +02:00
parent 65fea73f85
commit 31feb93d96
1 changed files with 11 additions and 4 deletions

View File

@ -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