Chromium Code Reviews| Index: chrome/browser/resources/settings/settings_ui/settings_ui.js |
| diff --git a/chrome/browser/resources/settings/settings_ui/settings_ui.js b/chrome/browser/resources/settings/settings_ui/settings_ui.js |
| index 61f75181fc068982fd9970aea9b49a26e6431cbe..bd0a58929697ed3de3244cd912f7bcddf2a63724 100644 |
| --- a/chrome/browser/resources/settings/settings_ui/settings_ui.js |
| +++ b/chrome/browser/resources/settings/settings_ui/settings_ui.js |
| @@ -36,9 +36,6 @@ Polymer({ |
| * @private {!GuestModePageVisibility} |
| */ |
| pageVisibility_: Object, |
| - |
| - /** @private */ |
| - drawerOpened_: Boolean, |
| }, |
| /** |
| @@ -51,6 +48,11 @@ Polymer({ |
| this.$$('settings-main').searchContents(e.detail); |
| }.bind(this)); |
| + // Lazy-create the drawer the first time it is opened or swiped into view. |
| + var drawer = assert(this.$$('app-drawer')); |
| + listenOnce( |
| + drawer, 'track opened-changed', this.onDrawerFirstShown_.bind(this)); |
|
Dan Beam
2016/09/01 03:02:01
nit:
listenOnce(this.$$('app-drawer'), 'track ope
michaelpg
2016/09/07 00:30:26
Done.
|
| + |
| window.addEventListener('popstate', function(e) { |
| this.$$('app-drawer').close(); |
| }.bind(this)); |
| @@ -109,4 +111,13 @@ Polymer({ |
| this.$$('app-drawer').align = this.directionDelegate.isRtl() ? |
| 'right' : 'left'; |
| }, |
| + |
| + /** |
| + * Ensures the settings-menu in the app-drawer is stamped. |
| + * @param {!Event} e |
| + * @private |
| + */ |
| + onDrawerFirstShown_: function(e) { |
| + this.$.drawerTemplate.if = true; |
| + }, |
| }); |