Focus default dialog if you click away from it.
This commit is contained in:
parent
d14c92248d
commit
729612d2e6
1 changed files with 7 additions and 6 deletions
|
@ -31,12 +31,6 @@ define([
|
|||
buttons: buttons
|
||||
});
|
||||
|
||||
modal.on("click", function(e) {
|
||||
if (e.target != modal) return;
|
||||
e.preventDefault();
|
||||
e.stopImmediatePropagation();
|
||||
});
|
||||
|
||||
document.body.append(modal);
|
||||
setTimeout(function() {
|
||||
//trigger enter animations
|
||||
|
@ -47,6 +41,13 @@ define([
|
|||
if (!defaultButton) defaultButton = modal.find("button");
|
||||
defaultButton.focus();
|
||||
|
||||
modal.on("click", function(e) {
|
||||
if (e.target != modal) return;
|
||||
e.preventDefault();
|
||||
e.stopImmediatePropagation();
|
||||
defaultButton.focus();
|
||||
});
|
||||
|
||||
var onKeyDown = function(e) {
|
||||
e.stopPropagation();
|
||||
e.stopImmediatePropagation();
|
||||
|
|
Loading…
Reference in a new issue