MDL-44079 Javascript: Check whether a dialogue is focused before closing
This commit is contained in:
@@ -95,6 +95,17 @@ Y.extend(DIALOGUE, Y.Panel, {
|
||||
}
|
||||
}
|
||||
},
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
return DIALOGUE.superclass.hide.call(this, arguments);
|
||||
},
|
||||
centerDialogue : function() {
|
||||
var bb = this.get('boundingBox'),
|
||||
hidden = bb.hasClass(DIALOGUE_PREFIX+'-hidden'),
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -95,6 +95,17 @@ Y.extend(DIALOGUE, Y.Panel, {
|
||||
}
|
||||
}
|
||||
},
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
return DIALOGUE.superclass.hide.call(this, arguments);
|
||||
},
|
||||
centerDialogue : function() {
|
||||
var bb = this.get('boundingBox'),
|
||||
hidden = bb.hasClass(DIALOGUE_PREFIX+'-hidden'),
|
||||
|
||||
+11
@@ -93,6 +93,17 @@ Y.extend(DIALOGUE, Y.Panel, {
|
||||
}
|
||||
}
|
||||
},
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
return DIALOGUE.superclass.hide.call(this, arguments);
|
||||
},
|
||||
centerDialogue : function() {
|
||||
var bb = this.get('boundingBox'),
|
||||
hidden = bb.hasClass(DIALOGUE_PREFIX+'-hidden'),
|
||||
|
||||
Reference in New Issue
Block a user