diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-02-20 14:48:38 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-02-20 14:48:38 +0000 |
commit | 72073b959487260755da4ccbb8fca445a8179cbb (patch) | |
tree | c5b1d0d1a56154ed9e8e27ac9ad3306a2c09cec6 | |
parent | 05ab3b1e8aee587f45416ef092920a620adad873 (diff) | |
download | brdo-72073b959487260755da4ccbb8fca445a8179cbb.tar.gz brdo-72073b959487260755da4ccbb8fca445a8179cbb.tar.bz2 |
- Patch #674852 by casey: keep tabs when navigating in the overlay.
-rw-r--r-- | modules/overlay/overlay-parent.js | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/modules/overlay/overlay-parent.js b/modules/overlay/overlay-parent.js index ab013f6d6..a30b83e9a 100644 --- a/modules/overlay/overlay-parent.js +++ b/modules/overlay/overlay-parent.js @@ -281,15 +281,27 @@ Drupal.overlay.load = function (url) { // spinner is centered. self.lastHeight = 0; self.outerResize(); - // No need to resize when loading. + // No need to resize while loading. clearTimeout(self.resizeTimeoutID); // Change the overlay title. self.$container.dialog('option', 'title', Drupal.t('Loading...')); // Remove any existing shortcut button markup in the title section. self.$dialogTitlebar.find('.add-or-remove-shortcuts').remove(); - // Remove any existing tabs in the title section. - self.$dialogTitlebar.find('ul').remove(); + // Remove any existing tabs in the title section, but only if requested url + // is not one of those tabs. If the latter, set that tab active. + var urlPath = self.getPath(url); + var $tabs = self.$dialogTitlebar.find('ul'); + var $tabsLinks = $tabs.find('> li > a'); + var $activeLink = $tabsLinks.filter(function () { return self.getPath(this) == urlPath; }); + if ($activeLink.length) { + var active_tab = Drupal.t('(active tab)'); + $tabsLinks.parent().removeClass('active').find('element-invisible:contains(' + active_tab + ')').appendTo($activeLink); + $activeLink.parent().addClass('active'); + } + else { + $tabs.remove(); + } // While the overlay is loading, we remove the loaded class from the dialog. // After the loading is finished, the loaded class is added back. The loaded |