Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Unified Diff: chrome/browser/resources/options/options_page.js

Issue 7572047: Remeber active tab in tab bar instead of 'this'. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options/options_page.js
diff --git a/chrome/browser/resources/options/options_page.js b/chrome/browser/resources/options/options_page.js
index f9903c6c8a0bee47f1bfa99aac7abd700cc5005a..8252af37c54b76457a7cb2e104e34a2f94162a69 100644
--- a/chrome/browser/resources/options/options_page.js
+++ b/chrome/browser/resources/options/options_page.js
@@ -338,15 +338,23 @@ cr.define('options', function() {
if (!tab || !tab.classList.contains('tab'))
return;
- if (this.activeNavTab != null) {
- this.activeNavTab.classList.remove('active-tab');
- $(this.activeNavTab.getAttribute('tab-contents')).classList.
+ // Find tab bar of the tab.
+ var tabBar = tab;
+ while (tabBar && !tabBar.classList.contains('subpages-nav-tabs')) {
+ tabBar = tabBar.parentNode;
+ }
+ if (!tabBar)
+ return;
+
+ if (tabBar.activeNavTab != null) {
+ tabBar.activeNavTab.classList.remove('active-tab');
+ $(tabBar.activeNavTab.getAttribute('tab-contents')).classList.
remove('active-tab-contents');
}
tab.classList.add('active-tab');
$(tab.getAttribute('tab-contents')).classList.add('active-tab-contents');
- this.activeNavTab = tab;
+ tabBar.activeNavTab = tab;
};
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698