Commit f2e8191e authored by dschuyler's avatar dschuyler Committed by Commit bot

[MD settings] close the side nav when navigating back/forward

This CL solves a problem with the side nav menu drawer staying open when
using the back/forward buttons. The drawer now closes when navigating
forward or back.

BUG=623903
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2170223002
Cr-Commit-Position: refs/heads/master@{#407290}
parent cdb475af
...@@ -66,6 +66,17 @@ Polymer({ ...@@ -66,6 +66,17 @@ Polymer({
'sideNav.iron-activate': 'onIronActivate_', 'sideNav.iron-activate': 'onIronActivate_',
}, },
/** @override */
ready: function() {
this.$$('cr-toolbar').addEventListener('search-changed', function(e) {
this.$$('settings-main').searchContents(e.detail);
}.bind(this));
window.addEventListener('popstate', function(e) {
this.$$('app-drawer').close();
}.bind(this));
},
/** @private */ /** @private */
onCloseAppealTap_: function() { onCloseAppealTap_: function() {
window.sessionStorage.appealClosed_ = this.appealClosed_ = true; window.sessionStorage.appealClosed_ = this.appealClosed_ = true;
...@@ -85,13 +96,6 @@ Polymer({ ...@@ -85,13 +96,6 @@ Polymer({
this.$$('app-drawer').toggle(); this.$$('app-drawer').toggle();
}, },
/** @override */
ready: function() {
this.$$('cr-toolbar').addEventListener('search-changed', function(e) {
this.$$('settings-main').searchContents(e.detail);
}.bind(this));
},
/** @private */ /** @private */
directionDelegateChanged_: function() { directionDelegateChanged_: function() {
this.$$('app-drawer').align = this.directionDelegate.isRtl() ? this.$$('app-drawer').align = this.directionDelegate.isRtl() ?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment