| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 /** | |
| 6 * @fileoverview | |
| 7 * 'settings-router' is only used to propagate route changes to bound elements. | |
| 8 * All the real routing is defined within route.js. | |
| 9 * TODO(tommycli): Remove once all elements migrated to RouteObserverBehavior. | |
| 10 * | |
| 11 * Example: | |
| 12 * <settings-router current-route="{{currentRoute}}"> | |
| 13 * </settings-router> | |
| 14 */ | |
| 15 Polymer({ | |
| 16 is: 'settings-router', | |
| 17 | |
| 18 behaviors: [settings.RouteObserverBehavior], | |
| 19 | |
| 20 properties: { | |
| 21 /** | |
| 22 * Only used to propagate settings.currentRoute to all the elements bound to | |
| 23 * settings-router. | |
| 24 * @type {!settings.Route} | |
| 25 */ | |
| 26 currentRoute: { | |
| 27 notify: true, | |
| 28 type: Object, | |
| 29 value: function() { return settings.getCurrentRoute(); }, | |
| 30 }, | |
| 31 }, | |
| 32 | |
| 33 /** @protected */ | |
| 34 currentRouteChanged: function() { | |
| 35 this.currentRoute = settings.getCurrentRoute(); | |
| 36 }, | |
| 37 }); | |
| OLD | NEW |