diff --git a/src/lib/data/html/speeddial.html b/src/lib/data/html/speeddial.html index daf0fc91d..02e8b4eb5 100644 --- a/src/lib/data/html/speeddial.html +++ b/src/lib/data/html/speeddial.html @@ -63,6 +63,15 @@ var SD_CENTER = %SD-CENTER%; var editingId = -1; +$(document).keyup(function(e) { + if (editingId == -1) + return; + if (e.keyCode == 13) + boxEdited(); + else if (e.keyCode == 27) + $('#fadeOverlay').click(); +}); + function addSpeedDial() { onEditClick(addBox('', NEW_PAGE, '')); @@ -112,18 +121,6 @@ function onRemoveClick(box) { removeBox($(box).index()); } -function onEditKeyPress(e) { - if (e.keyCode == 13) { - boxEdited(); - return false; - } - else if (e.keyCode == 27) { - $('#fadeOverlay').click(); - return false; - } - return true; -} - function onFetchTitleClick(checkbox) { var displayStyle; checkbox.checked ? displayStyle = 'hidden' : displayStyle = 'visible'; @@ -142,7 +139,7 @@ function onEditClick(box) { boxUrl = 'http://'; $('body').append('