| 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, 'track opened-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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 query.length > 0 ? | 166 query.length > 0 ? |
| 168 new URLSearchParams(`search=${query}`) : undefined); | 167 new URLSearchParams(`search=${query}`) : undefined); |
| 169 }, | 168 }, |
| 170 | 169 |
| 171 /** | 170 /** |
| 172 * @param {Event} event | 171 * @param {Event} event |
| 173 * @private | 172 * @private |
| 174 */ | 173 */ |
| 175 onIronActivate_: function(event) { | 174 onIronActivate_: function(event) { |
| 176 if (event.detail.item.id != 'advancedPage') | 175 if (event.detail.item.id != 'advancedPage') |
| 177 this.$$('app-drawer').close(); | 176 this.$.drawer.close(); |
| 178 }, | 177 }, |
| 179 | 178 |
| 180 /** @private */ | 179 /** @private */ |
| 181 onMenuButtonTap_: function() { | 180 onMenuButtonTap_: function() { |
| 182 this.$$('app-drawer').toggle(); | 181 this.$.drawer.toggle(); |
| 183 }, | 182 }, |
| 184 | 183 |
| 185 /** @private */ | 184 /** @private */ |
| 186 directionDelegateChanged_: function() { | 185 directionDelegateChanged_: function() { |
| 187 this.$$('app-drawer').align = this.directionDelegate.isRtl() ? | 186 this.$.drawer.align = this.directionDelegate.isRtl() ? |
| 188 'right' : 'left'; | 187 'right' : 'left'; |
| 189 }, | 188 }, |
| 190 }); | 189 }); |
| OLD | NEW |