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
|
||||
|
@ -46,6 +40,13 @@ define([
|
|||
var defaultButton = modal.find("button.default");
|
||||
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();
|
||||
|
|
Loading…
Reference in a new issue