MDL-44079 Javascript: Check whether a dialogue is focused before closing
This commit is contained in:
+9
-1
@@ -350,7 +350,15 @@ Y.extend(DIALOGUE, Y.Panel, {
|
||||
return result;
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
hide: function(e) {
|
||||
if (e) {
|
||||
// If the event was closed by an escape key event, then we need to check that this
|
||||
// dialogue is currently focused to prevent closing all dialogues in the stack.
|
||||
if (e.type === 'key' && e.keyCode === 27 && !this.get('focused')) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Unlock scroll if the plugin is present.
|
||||
if (this.lockScroll) {
|
||||
this.lockScroll.disableScrollLock();
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+9
-1
@@ -350,7 +350,15 @@ Y.extend(DIALOGUE, Y.Panel, {
|
||||
return result;
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
hide: function(e) {
|
||||
if (e) {
|
||||
// If the event was closed by an escape key event, then we need to check that this
|
||||
// dialogue is currently focused to prevent closing all dialogues in the stack.
|
||||
if (e.type === 'key' && e.keyCode === 27 && !this.get('focused')) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Unlock scroll if the plugin is present.
|
||||
if (this.lockScroll) {
|
||||
this.lockScroll.disableScrollLock();
|
||||
|
||||
+9
-1
@@ -319,7 +319,15 @@ Y.extend(DIALOGUE, Y.Panel, {
|
||||
return result;
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
hide: function(e) {
|
||||
if (e) {
|
||||
// If the event was closed by an escape key event, then we need to check that this
|
||||
// dialogue is currently focused to prevent closing all dialogues in the stack.
|
||||
if (e.type === 'key' && e.keyCode === 27 && !this.get('focused')) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Unlock scroll if the plugin is present.
|
||||
if (this.lockScroll) {
|
||||
this.lockScroll.disableScrollLock();
|
||||
|
||||
Reference in New Issue
Block a user