summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-07-25 00:44:29 +0000
committerDries Buytaert <dries@buytaert.net>2010-07-25 00:44:29 +0000
commit13f8a95296f6ae5ab4fd2d30f50611f39cc068b4 (patch)
tree7cbfac932524dedd30c4143657c58055a69cb5d1
parent03d7c314d8ba884843d3059cd7db58ce6ca903a0 (diff)
downloadbrdo-13f8a95296f6ae5ab4fd2d30f50611f39cc068b4.tar.gz
brdo-13f8a95296f6ae5ab4fd2d30f50611f39cc068b4.tar.bz2
- Patch #762348 by tstoeckler, BarisW, casey: update the document title using jQuery while using the overlay window.
-rw-r--r--modules/overlay/overlay-parent.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/overlay/overlay-parent.js b/modules/overlay/overlay-parent.js
index b0cd7be74..78ad6ec55 100644
--- a/modules/overlay/overlay-parent.js
+++ b/modules/overlay/overlay-parent.js
@@ -70,6 +70,8 @@ Drupal.overlay.open = function (url) {
return this.load(url);
}
this.isOpening = true;
+ // Store the original document title.
+ this.originalTitle = document.title;
// Create the dialog and related DOM elements.
this.create();
@@ -184,6 +186,8 @@ Drupal.overlay.close = function () {
this.isClosing = true;
this.isOpen = false;
$(document.documentElement).removeClass('overlay-open');
+ // Restore the original document title.
+ document.title = this.originalTitle;
// Allow other scripts to respond to this event.
$(document).trigger('drupalOverlayClose');
@@ -273,6 +277,9 @@ Drupal.overlay.loadChild = function (event) {
if (this.isOpen && !this.isClosing) {
// And child document is an actual overlayChild.
if (iframeWindow.Drupal && iframeWindow.Drupal.overlayChild) {
+ // Replace the document title with title of iframe.
+ document.title = iframeWindow.document.title;
+
this.activeFrame = $(iframe)
.addClass('overlay-active')
// Add a title attribute to the iframe for accessibility.