| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 // Nothing to do if the subpage isn't wrapped in a <template> or the | 140 // Nothing to do if the subpage isn't wrapped in a <template> or the |
| 141 // template is already stamped. | 141 // template is already stamped. |
| 142 if (!template || template.if) | 142 if (!template || template.if) |
| 143 return; | 143 return; |
| 144 | 144 |
| 145 // Set the subpage's id for use by neon-animated-pages. | 145 // Set the subpage's id for use by neon-animated-pages. |
| 146 var subpage = /** @type {{_content: DocumentFragment}} */(template)._content | 146 var subpage = /** @type {{_content: DocumentFragment}} */(template)._content |
| 147 .querySelector('settings-subpage'); | 147 .querySelector('settings-subpage'); |
| 148 if (!subpage.id) | 148 if (!subpage.id) |
| 149 subpage.id = id; | 149 subpage.id = id; |
| 150 // Carry over the 'no-search' attribute from the template to the stamped |
| 151 // instance, such that the stamped instance will also be ignored by the |
| 152 // searching algorithm. |
| 153 if (template.hasAttribute('no-search')) |
| 154 subpage.setAttribute('no-search', ''); |
| 150 | 155 |
| 151 // Render synchronously so neon-animated-pages can select the subpage. | 156 // Render synchronously so neon-animated-pages can select the subpage. |
| 152 template.if = true; | 157 template.if = true; |
| 153 template.render(); | 158 template.render(); |
| 154 }, | 159 }, |
| 155 }); | 160 }); |
| OLD | NEW |