Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 var node = event.currentTarget; | |
|
dpapad
2016/05/27 00:44:22
Where is |event| coming from?
dschuyler
2016/05/27 01:30:49
I commented that it's a global, but there
is still
| |
| 150 var page; | |
| 151 while (node) { | |
| 152 if (node.dataset && node.dataset.page) | |
| 153 page = node.dataset.page; | |
| 154 node = node.host || node.parentNode; | |
|
dpapad
2016/05/27 00:44:22
What is the expected type(s) of |node|? I recogniz
dschuyler
2016/05/27 01:30:49
Done.
| |
| 155 } | |
| 149 this.currentRoute = { | 156 this.currentRoute = { |
| 150 page: this.currentRoute.page, | 157 page: page, |
| 151 section: subpage.length > 0 ? this.section : '', | 158 section: subpage.length > 0 ? this.section : '', |
| 152 subpage: subpage, | 159 subpage: subpage, |
| 153 }; | 160 }; |
| 154 }, | 161 }, |
| 155 }); | 162 }); |
| OLD | NEW |