summaryrefslogtreecommitdiff
path: root/modules/overlay
diff options
context:
space:
mode:
Diffstat (limited to 'modules/overlay')
-rw-r--r--modules/overlay/overlay-child.js4
-rw-r--r--modules/overlay/overlay-parent.js14
2 files changed, 8 insertions, 10 deletions
diff --git a/modules/overlay/overlay-child.js b/modules/overlay/overlay-child.js
index 018445517..7570ec613 100644
--- a/modules/overlay/overlay-child.js
+++ b/modules/overlay/overlay-child.js
@@ -31,8 +31,8 @@ Drupal.behaviors.overlayChild = {
// may have decided to tell us the parent window to close the popup dialog.
if (settings.closeOverlay) {
parent.Drupal.overlay.bindChild(window, true);
- // Close the child window from a separate thread because the current
- // one is busy processing Drupal behaviors.
+ // Use setTimeout to close the child window from a separate thread,
+ // because the current one is busy processing Drupal behaviors.
setTimeout(function () {
// We need to store the parent variable locally because it will
// disappear as soon as we close the iframe.
diff --git a/modules/overlay/overlay-parent.js b/modules/overlay/overlay-parent.js
index 2ed3914cf..d362a945d 100644
--- a/modules/overlay/overlay-parent.js
+++ b/modules/overlay/overlay-parent.js
@@ -517,7 +517,7 @@ Drupal.overlay.bindChild = function (iframeWindow, isClosing) {
if (!$target.size()) {
$target = self.$iframeDocument;
}
- setTimeout(function () { $target.focus(); }, 10);
+ $target.focus();
return false;
}
});
@@ -528,16 +528,16 @@ Drupal.overlay.bindChild = function (iframeWindow, isClosing) {
if (event.keyCode) {
if (event.keyCode == $.ui.keyCode.TAB) {
if (event.shiftKey && event.target == $firstTabbable.get(0)) {
- setTimeout(function () { $closeButton.focus(); }, 10);
+ $closeButton.focus();
return false;
}
else if (!event.shiftKey && event.target == $lastTabbable.get(0)) {
- setTimeout(function () { $closeButton.focus(); }, 10);
+ $closeButton.focus();
return false;
}
}
else if (event.keyCode == $.ui.keyCode.ESCAPE) {
- setTimeout(function () { self.close(); }, 10);
+ self.close();
return false;
}
}
@@ -548,11 +548,9 @@ Drupal.overlay.bindChild = function (iframeWindow, isClosing) {
// close button of the dialog (default).
$(document).bind('keydown.overlay-event', function (event) {
if (event.keyCode && event.keyCode == $.ui.keyCode.TAB) {
- setTimeout(function () {
- if (!self.$iframeWindow(':tabbable:not(form):first').focus().size()) {
+ if (!self.$iframeWindow(':tabbable:not(form):first').focus().size()) {
$closeButton.focus();
- }
- }, 10);
+ }
return false;
}
});