Skip to content
This repository has been archived by the owner on Jan 12, 2022. It is now read-only.

Commit

Permalink
fixes bug 638223 - Delete confirmation modal does not go away when yo…
Browse files Browse the repository at this point in the history
…u hit enter
  • Loading branch information
seanmonstar committed Mar 18, 2011
1 parent f2c30a5 commit da33717
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions media/base/js/FlightDeck.Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,19 @@ FlightDeck = Class.refactor(FlightDeck,{

//auto focus first input if it exists
//also listen for the enter key if a text input exists
textboxes = $(display).getElements('input[type="text"]').addEvent(
'keyup:keys(enter)', function(e) {
e.preventDefault();
if (main_callback) {
main_callback();
}
function pressEnter(e) {
e.stop();
main_callback();
display.destroy();
}

window.addEvent('keyup:keys(enter)', pressEnter);
display.addEvent('destroy', function() {
window.removeEvent('keyup:keys(enter)', pressEnter);
});

textboxes = $(display).getElements('input[type="text"]');

if (data.focus && textboxes.length) {
setTimeout(function() {
textboxes[0].focus();
Expand Down

0 comments on commit da33717

Please sign in to comment.