| 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 /** | 5 /** |
| 6 * @fileoverview | 6 * @fileoverview |
| 7 * 'settings-subpage' shows a subpage beneath a subheader. The header contains | 7 * 'settings-subpage' shows a subpage beneath a subheader. The header contains |
| 8 * the subpage title and a back icon. | 8 * the subpage title and a back icon. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 * @type {?HTMLElement} | 36 * @type {?HTMLElement} |
| 37 */ | 37 */ |
| 38 associatedControl: { | 38 associatedControl: { |
| 39 type: Object, | 39 type: Object, |
| 40 value: null, | 40 value: null, |
| 41 }, | 41 }, |
| 42 }, | 42 }, |
| 43 | 43 |
| 44 /** @private */ | 44 /** @private */ |
| 45 onTapBack_: function() { | 45 onTapBack_: function() { |
| 46 settings.navigateTo(assert(settings.getCurrentRoute().parent)); | 46 var previousRoute = |
| 47 window.history.state && |
| 48 assert(settings.getRouteForPath( |
| 49 /** @type {string} */ (window.history.state))); |
| 50 |
| 51 if (previousRoute && previousRoute.contains(settings.getCurrentRoute())) |
| 52 window.history.back(); |
| 53 else |
| 54 settings.navigateTo(assert(settings.getCurrentRoute().parent)); |
| 47 }, | 55 }, |
| 48 | 56 |
| 49 /** @private */ | 57 /** @private */ |
| 50 onSearchChanged_: function(e) { | 58 onSearchChanged_: function(e) { |
| 51 this.searchTerm = e.detail; | 59 this.searchTerm = e.detail; |
| 52 }, | 60 }, |
| 53 }); | 61 }); |
| OLD | NEW |