mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
MDL-44079 Javascript: Check whether a dialogue is focused before closing
This commit is contained in:
parent
974c2cdc03
commit
bf24abd221
@ -340,7 +340,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();
|
||||
|
File diff suppressed because one or more lines are too long
@ -340,7 +340,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();
|
||||
|
10
lib/yui/src/notification/js/dialogue.js
vendored
10
lib/yui/src/notification/js/dialogue.js
vendored
@ -309,7 +309,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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user