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-ui' implements the UI for the Settings page. | 7 * 'settings-ui' implements the UI for the Settings page. |
8 * | 8 * |
9 * Example: | 9 * Example: |
10 * | 10 * |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 toolbarSpinnerActive_: { | 59 toolbarSpinnerActive_: { |
60 type: Boolean, | 60 type: Boolean, |
61 value: false, | 61 value: false, |
62 }, | 62 }, |
63 }, | 63 }, |
64 | 64 |
65 listeners: { | 65 listeners: { |
66 'sideNav.iron-activate': 'onIronActivate_', | 66 'sideNav.iron-activate': 'onIronActivate_', |
67 }, | 67 }, |
68 | 68 |
| 69 /** @override */ |
| 70 ready: function() { |
| 71 this.$$('cr-toolbar').addEventListener('search-changed', function(e) { |
| 72 this.$$('settings-main').searchContents(e.detail); |
| 73 }.bind(this)); |
| 74 |
| 75 window.addEventListener('popstate', function(e) { |
| 76 this.$$('app-drawer').close(); |
| 77 }.bind(this)); |
| 78 }, |
| 79 |
69 /** @private */ | 80 /** @private */ |
70 onCloseAppealTap_: function() { | 81 onCloseAppealTap_: function() { |
71 window.sessionStorage.appealClosed_ = this.appealClosed_ = true; | 82 window.sessionStorage.appealClosed_ = this.appealClosed_ = true; |
72 }, | 83 }, |
73 | 84 |
74 /** | 85 /** |
75 * @param {Event} event | 86 * @param {Event} event |
76 * @private | 87 * @private |
77 */ | 88 */ |
78 onIronActivate_: function(event) { | 89 onIronActivate_: function(event) { |
79 if (event.detail.item.id != 'advancedPage') | 90 if (event.detail.item.id != 'advancedPage') |
80 this.$$('app-drawer').close(); | 91 this.$$('app-drawer').close(); |
81 }, | 92 }, |
82 | 93 |
83 /** @private */ | 94 /** @private */ |
84 onMenuButtonTap_: function() { | 95 onMenuButtonTap_: function() { |
85 this.$$('app-drawer').toggle(); | 96 this.$$('app-drawer').toggle(); |
86 }, | 97 }, |
87 | 98 |
88 /** @override */ | |
89 ready: function() { | |
90 this.$$('cr-toolbar').addEventListener('search-changed', function(e) { | |
91 this.$$('settings-main').searchContents(e.detail); | |
92 }.bind(this)); | |
93 }, | |
94 | |
95 /** @private */ | 99 /** @private */ |
96 directionDelegateChanged_: function() { | 100 directionDelegateChanged_: function() { |
97 this.$$('app-drawer').align = this.directionDelegate.isRtl() ? | 101 this.$$('app-drawer').align = this.directionDelegate.isRtl() ? |
98 'right' : 'left'; | 102 'right' : 'left'; |
99 }, | 103 }, |
100 }); | 104 }); |
OLD | NEW |