| 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 18 matching lines...) Expand all Loading... |
| 29 toolbarSpinnerActive_: { | 29 toolbarSpinnerActive_: { |
| 30 type: Boolean, | 30 type: Boolean, |
| 31 value: false, | 31 value: false, |
| 32 }, | 32 }, |
| 33 | 33 |
| 34 /** | 34 /** |
| 35 * Dictionary defining page visibility. | 35 * Dictionary defining page visibility. |
| 36 * @private {!GuestModePageVisibility} | 36 * @private {!GuestModePageVisibility} |
| 37 */ | 37 */ |
| 38 pageVisibility_: Object, | 38 pageVisibility_: Object, |
| 39 | |
| 40 /** @private */ | |
| 41 drawerOpened_: Boolean, | |
| 42 }, | 39 }, |
| 43 | 40 |
| 44 /** | 41 /** |
| 45 * @override | 42 * @override |
| 46 * @suppress {es5Strict} Object literals cannot contain duplicate keys in ES5 | 43 * @suppress {es5Strict} Object literals cannot contain duplicate keys in ES5 |
| 47 * strict mode. | 44 * strict mode. |
| 48 */ | 45 */ |
| 49 ready: function() { | 46 ready: function() { |
| 50 this.$$('cr-toolbar').addEventListener('search-changed', function(e) { | 47 this.$$('cr-toolbar').addEventListener('search-changed', function(e) { |
| 51 this.$$('settings-main').searchContents(e.detail); | 48 this.$$('settings-main').searchContents(e.detail); |
| 52 }.bind(this)); | 49 }.bind(this)); |
| 53 | 50 |
| 51 // Lazy-create the drawer the first time it is opened or swiped into view. |
| 52 var drawer = assert(this.$$('app-drawer')); |
| 53 listenOnce(drawer, 'track opened-changed', function() { |
| 54 this.$.drawerTemplate.if = true; |
| 55 }.bind(this)); |
| 56 |
| 54 window.addEventListener('popstate', function(e) { | 57 window.addEventListener('popstate', function(e) { |
| 55 this.$$('app-drawer').close(); | 58 drawer.close(); |
| 56 }.bind(this)); | 59 }.bind(this)); |
| 57 | 60 |
| 58 if (loadTimeData.getBoolean('isGuest')) { | 61 if (loadTimeData.getBoolean('isGuest')) { |
| 59 this.pageVisibility_ = { | 62 this.pageVisibility_ = { |
| 60 people: false, | 63 people: false, |
| 61 onStartup: false, | 64 onStartup: false, |
| 62 reset: false, | 65 reset: false, |
| 63 <if expr="not chromeos"> | 66 <if expr="not chromeos"> |
| 64 appearance: false, | 67 appearance: false, |
| 65 defaultBrowser: false, | 68 defaultBrowser: false, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 onMenuButtonTap_: function() { | 106 onMenuButtonTap_: function() { |
| 104 this.$$('app-drawer').toggle(); | 107 this.$$('app-drawer').toggle(); |
| 105 }, | 108 }, |
| 106 | 109 |
| 107 /** @private */ | 110 /** @private */ |
| 108 directionDelegateChanged_: function() { | 111 directionDelegateChanged_: function() { |
| 109 this.$$('app-drawer').align = this.directionDelegate.isRtl() ? | 112 this.$$('app-drawer').align = this.directionDelegate.isRtl() ? |
| 110 'right' : 'left'; | 113 'right' : 'left'; |
| 111 }, | 114 }, |
| 112 }); | 115 }); |
| OLD | NEW |