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

Unified Diff: chrome/browser/resources/settings/settings_page/settings_animated_pages.js

Issue 2018753002: [MD settings] refine routing function (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review change Created 4 years, 7 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
Index: chrome/browser/resources/settings/settings_page/settings_animated_pages.js
diff --git a/chrome/browser/resources/settings/settings_page/settings_animated_pages.js b/chrome/browser/resources/settings/settings_page/settings_animated_pages.js
index 27869cd148599361af67adf5b853bb64e28549be..f40647ee78002f28f337bab037e4a0dac8b1f90d 100644
--- a/chrome/browser/resources/settings/settings_page/settings_animated_pages.js
+++ b/chrome/browser/resources/settings/settings_page/settings_animated_pages.js
@@ -146,8 +146,16 @@ Polymer({
* Buttons in this pageset should use this method to transition to subpages.
*/
setSubpageChain: function(subpage) {
+ var node = window.event.currentTarget;
+ var page;
+ while (node) {
+ if (node.dataset && node.dataset.page)
+ page = node.dataset.page;
+ // A shadow root has a |host| rather than a |parentNode|.
+ node = node.host || node.parentNode;
+ }
this.currentRoute = {
- page: this.currentRoute.page,
+ page: page,
section: subpage.length > 0 ? this.section : '',
subpage: subpage,
};
« no previous file with comments | « chrome/browser/resources/settings/basic_page/basic_page.html ('k') | chrome/browser/resources/settings/settings_page_css.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698