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

Side by Side 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: added comments 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * 'settings-animated-pages' is a container for a page and animated subpages. 7 * 'settings-animated-pages' is a container for a page and animated subpages.
8 * It provides a set of common behaviors and animations. 8 * It provides a set of common behaviors and animations.
9 * 9 *
10 * Example: 10 * Example:
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 139
140 // Render synchronously so neon-animated-pages can select the subpage. 140 // Render synchronously so neon-animated-pages can select the subpage.
141 template.if = true; 141 template.if = true;
142 template.render(); 142 template.render();
143 }, 143 },
144 144
145 /** 145 /**
146 * Buttons in this pageset should use this method to transition to subpages. 146 * Buttons in this pageset should use this method to transition to subpages.
147 */ 147 */
148 setSubpageChain: function(subpage) { 148 setSubpageChain: function(subpage) {
149 // The event var is a global reference to the current event.
Dan Beam 2016/05/27 22:24:06 use window.event then... also, ew
dschuyler 2016/05/28 00:09:03 Done.
150 var node = event.currentTarget;
151 var page;
152 while (node) {
153 if (node.dataset && node.dataset.page)
154 page = node.dataset.page;
155 // A shadow root has a |host| rather than a |parentNode|.
156 node = node.host || node.parentNode;
157 }
149 this.currentRoute = { 158 this.currentRoute = {
150 page: this.currentRoute.page, 159 page: page,
151 section: subpage.length > 0 ? this.section : '', 160 section: subpage.length > 0 ? this.section : '',
152 subpage: subpage, 161 subpage: subpage,
153 }; 162 };
154 }, 163 },
155 }); 164 });
OLDNEW
« 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