| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 settings.initializeRouteFromUrl(); | 65 settings.initializeRouteFromUrl(); |
| 66 }, | 66 }, |
| 67 | 67 |
| 68 /** | 68 /** |
| 69 * @override | 69 * @override |
| 70 * @suppress {es5Strict} Object literals cannot contain duplicate keys in ES5 | 70 * @suppress {es5Strict} Object literals cannot contain duplicate keys in ES5 |
| 71 * strict mode. | 71 * strict mode. |
| 72 */ | 72 */ |
| 73 ready: function() { | 73 ready: function() { |
| 74 // Lazy-create the drawer the first time it is opened or swiped into view. | 74 // Lazy-create the drawer the first time it is opened or swiped into view. |
| 75 var drawer = assert(this.$$('app-drawer')); | 75 listenOnce(this.$.drawer, 'open-changed', function() { |
| 76 listenOnce(drawer, 'track opened-changed', function() { | |
| 77 this.$.drawerTemplate.if = true; | 76 this.$.drawerTemplate.if = true; |
| 78 }.bind(this)); | 77 }.bind(this)); |
| 79 | 78 |
| 80 window.addEventListener('popstate', function(e) { | 79 window.addEventListener('popstate', function(e) { |
| 81 drawer.close(); | 80 this.$.drawer.close(); |
| 82 }.bind(this)); | 81 }.bind(this)); |
| 83 | 82 |
| 84 if (loadTimeData.getBoolean('isGuest')) { | 83 if (loadTimeData.getBoolean('isGuest')) { |
| 85 this.pageVisibility_ = { | 84 this.pageVisibility_ = { |
| 86 people: false, | 85 people: false, |
| 87 onStartup: false, | 86 onStartup: false, |
| 88 reset: false, | 87 reset: false, |
| 89 <if expr="not chromeos"> | 88 <if expr="not chromeos"> |
| 90 appearance: false, | 89 appearance: false, |
| 91 defaultBrowser: false, | 90 defaultBrowser: false, |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 query.length > 0 ? new URLSearchParams(`search=${query}`) : undefined, | 161 query.length > 0 ? new URLSearchParams(`search=${query}`) : undefined, |
| 163 /* removeSearch */ true); | 162 /* removeSearch */ true); |
| 164 }, | 163 }, |
| 165 | 164 |
| 166 /** | 165 /** |
| 167 * @param {Event} event | 166 * @param {Event} event |
| 168 * @private | 167 * @private |
| 169 */ | 168 */ |
| 170 onIronActivate_: function(event) { | 169 onIronActivate_: function(event) { |
| 171 if (event.detail.item.id != 'advancedPage') | 170 if (event.detail.item.id != 'advancedPage') |
| 172 this.$$('app-drawer').close(); | 171 this.$.drawer.close(); |
| 173 }, | 172 }, |
| 174 | 173 |
| 175 /** @private */ | 174 /** @private */ |
| 176 onMenuButtonTap_: function() { | 175 onMenuButtonTap_: function() { |
| 177 this.$$('app-drawer').toggle(); | 176 this.$.drawer.toggle(); |
| 178 }, | 177 }, |
| 179 | 178 |
| 180 /** @private */ | 179 /** @private */ |
| 181 directionDelegateChanged_: function() { | 180 directionDelegateChanged_: function() { |
| 182 this.$$('app-drawer').align = this.directionDelegate.isRtl() ? | 181 this.$.drawer.align = this.directionDelegate.isRtl() ? |
| 183 'right' : 'left'; | 182 'right' : 'left'; |
| 184 }, | 183 }, |
| 185 }); | 184 }); |
| OLD | NEW |