Skip to content

Commit 3c0108e

Browse files
pranavsbfederle
authored andcommitted
Bug 14476: ESC causes UI to freeze
1 parent dc1af9e commit 3c0108e

1 file changed

Lines changed: 25 additions & 2 deletions

File tree

‎ui/scripts/ui/dialog.js‎

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,27 @@
5252
if (field.hidden || field.isHidden) $formItem.hide();
5353

5454
$formItem.appendTo($form);
55-
55+
56+
//Handling Escape KeyPress events
57+
/* $('.ui-dialog').keypress(function(event) {
58+
if ( event.which == 27 ) {
59+
event.stopPropagation();
60+
}
61+
});
62+
63+
$(document).ready(function(){
64+
$('.ui-dialog').keydown(function(event) {
65+
if(event.keyCode == 27)
66+
{
67+
alert("you pressed the Escape key");
68+
event.preventdefault();
69+
}
70+
})
71+
});
72+
73+
$(':ui-dialog').dialog({
74+
closeOnEscape: false
75+
}); */
5676
// Label field
5777
var $name = $('<div>').addClass('name')
5878
.appendTo($formItem)
@@ -238,7 +258,7 @@
238258
$form.show();
239259

240260
// Form should be slightly wider
241-
$form.closest(':ui-dialog').dialog('option', { position: 'center' });
261+
$form.closest(':ui-dialog').dialog('option', { position: 'center',closeOnEscape: false });
242262
}
243263
}
244264
});
@@ -332,6 +352,7 @@
332352

333353
return $formContainer.dialog({
334354
dialogClass: 'create-form',
355+
closeOnEscape: false,
335356
width: 400,
336357
title: _l(args.form.title),
337358
open: function() {
@@ -377,6 +398,7 @@
377398
).dialog({
378399
title: _l('label.confirmation'),
379400
dialogClass: 'confirm',
401+
closeOnEscape: false,
380402
zIndex: 5000,
381403
buttons: [
382404
{
@@ -412,6 +434,7 @@
412434
).dialog({
413435
title: _l('label.status'),
414436
dialogClass: 'notice',
437+
closeOnEscape: false,
415438
zIndex: 5000,
416439
buttons: [
417440
{

0 commit comments

Comments
 (0)