| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 Polymer({ | 5 Polymer({ |
| 6 is: 'history-router', | 6 is: 'history-router', |
| 7 | 7 |
| 8 properties: { | 8 properties: { |
| 9 selectedPage: { | 9 selectedPage: { |
| 10 type: String, | 10 type: String, |
| 11 observer: 'serializePath_', | 11 observer: 'serializePath_', |
| 12 notify: true, | 12 notify: true, |
| 13 }, | 13 }, |
| 14 | 14 |
| 15 queryState: { | 15 queryState: { |
| 16 type: Object, | 16 type: Object, |
| 17 notify: true | 17 notify: true, |
| 18 }, | 18 }, |
| 19 | 19 |
| 20 path_: { | 20 path_: { |
| 21 type: String, | 21 type: String, |
| 22 observer: 'pathChanged_' | 22 observer: 'pathChanged_', |
| 23 }, | 23 }, |
| 24 | 24 |
| 25 queryParams_: Object, | 25 queryParams_: Object, |
| 26 }, | 26 }, |
| 27 | 27 |
| 28 observers: [ | 28 observers: [ |
| 29 'queryParamsChanged_(queryParams_.*)', | 29 'queryParamsChanged_(queryParams_.*)', |
| 30 'searchTermChanged_(queryState.searchTerm)', | 30 'searchTermChanged_(queryState.searchTerm)', |
| 31 ], | 31 ], |
| 32 | 32 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 54 /** @private */ | 54 /** @private */ |
| 55 queryParamsChanged_: function() { | 55 queryParamsChanged_: function() { |
| 56 this.set('queryState.searchTerm', this.queryParams_.q || ''); | 56 this.set('queryState.searchTerm', this.queryParams_.q || ''); |
| 57 }, | 57 }, |
| 58 | 58 |
| 59 /** @private */ | 59 /** @private */ |
| 60 searchTermChanged_: function() { | 60 searchTermChanged_: function() { |
| 61 this.set('queryParams_.q', this.queryState.searchTerm || null); | 61 this.set('queryParams_.q', this.queryState.searchTerm || null); |
| 62 }, | 62 }, |
| 63 }); | 63 }); |
| OLD | NEW |