Chromium Code Reviews| 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, 'opened-changed', this.onDrawerFirstShown_.bind(this)); | |
| 54 listenOnce(drawer, 'track', this.onDrawerFirstShown_.bind(this)); | |
|
Dan Beam
2016/09/01 01:33:13
don't we really want this to fire once only on the
michaelpg
2016/09/01 02:20:26
Yeah. It wasn't a big deal since it's basically a
| |
| 55 | |
| 54 window.addEventListener('popstate', function(e) { | 56 window.addEventListener('popstate', function(e) { |
| 55 this.$$('app-drawer').close(); | 57 this.$$('app-drawer').close(); |
| 56 }.bind(this)); | 58 }.bind(this)); |
| 57 | 59 |
| 58 if (loadTimeData.getBoolean('isGuest')) { | 60 if (loadTimeData.getBoolean('isGuest')) { |
| 59 this.pageVisibility_ = { | 61 this.pageVisibility_ = { |
| 60 people: false, | 62 people: false, |
| 61 onStartup: false, | 63 onStartup: false, |
| 62 reset: false, | 64 reset: false, |
| 63 <if expr="not chromeos"> | 65 <if expr="not chromeos"> |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 102 /** @private */ | 104 /** @private */ |
| 103 onMenuButtonTap_: function() { | 105 onMenuButtonTap_: function() { |
| 104 this.$$('app-drawer').toggle(); | 106 this.$$('app-drawer').toggle(); |
| 105 }, | 107 }, |
| 106 | 108 |
| 107 /** @private */ | 109 /** @private */ |
| 108 directionDelegateChanged_: function() { | 110 directionDelegateChanged_: function() { |
| 109 this.$$('app-drawer').align = this.directionDelegate.isRtl() ? | 111 this.$$('app-drawer').align = this.directionDelegate.isRtl() ? |
| 110 'right' : 'left'; | 112 'right' : 'left'; |
| 111 }, | 113 }, |
| 114 | |
| 115 /** | |
| 116 * Ensures the settings-menu in the app-drawer is stamped. | |
| 117 * @param {!Event} e | |
| 118 * @private | |
| 119 */ | |
| 120 onDrawerFirstShown_: function(e) { | |
| 121 this.$.drawerTemplate.if = true; | |
| 122 }, | |
| 112 }); | 123 }); |
| OLD | NEW |