| 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 18 matching lines...) Expand all Loading... |
| 29 section: { | 29 section: { |
| 30 type: String, | 30 type: String, |
| 31 }, | 31 }, |
| 32 }, | 32 }, |
| 33 | 33 |
| 34 /** @override */ | 34 /** @override */ |
| 35 created: function() { | 35 created: function() { |
| 36 // Observe the light DOM so we know when it's ready. | 36 // Observe the light DOM so we know when it's ready. |
| 37 this.lightDomObserver_ = Polymer.dom(this).observeNodes( | 37 this.lightDomObserver_ = Polymer.dom(this).observeNodes( |
| 38 this.lightDomChanged_.bind(this)); | 38 this.lightDomChanged_.bind(this)); |
| 39 | |
| 40 this.addEventListener('subpage-back', function() { | |
| 41 var parent = settings.getCurrentRoute().parent; | |
| 42 assert(parent); | |
| 43 settings.navigateTo(parent); | |
| 44 }.bind(this)); | |
| 45 }, | 39 }, |
| 46 | 40 |
| 47 /** | 41 /** |
| 48 * Called initially once the effective children are ready. | 42 * Called initially once the effective children are ready. |
| 49 * @private | 43 * @private |
| 50 */ | 44 */ |
| 51 lightDomChanged_: function() { | 45 lightDomChanged_: function() { |
| 52 if (this.lightDomReady_) | 46 if (this.lightDomReady_) |
| 53 return; | 47 return; |
| 54 | 48 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 var subpage = /** @type {{_content: DocumentFragment}} */(template)._content | 140 var subpage = /** @type {{_content: DocumentFragment}} */(template)._content |
| 147 .querySelector('settings-subpage'); | 141 .querySelector('settings-subpage'); |
| 148 if (!subpage.id) | 142 if (!subpage.id) |
| 149 subpage.id = id; | 143 subpage.id = id; |
| 150 | 144 |
| 151 // Render synchronously so neon-animated-pages can select the subpage. | 145 // Render synchronously so neon-animated-pages can select the subpage. |
| 152 template.if = true; | 146 template.if = true; |
| 153 template.render(); | 147 template.render(); |
| 154 }, | 148 }, |
| 155 }); | 149 }); |
| OLD | NEW |