Focus default dialog if you click away from it.

This commit is contained in:
Thomas Wilburn 2014-05-12 21:17:55 -07:00
parent d14c92248d
commit 729612d2e6

View file

@ -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();