Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(653)

Side by Side Diff: chrome/browser/resources/settings/settings_ui/settings_ui.js

Issue 2170223002: [MD settings] close the side nav when navigating back/forward (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 toolbarSpinnerActive_: { 59 toolbarSpinnerActive_: {
60 type: Boolean, 60 type: Boolean,
61 value: false, 61 value: false,
62 }, 62 },
63 }, 63 },
64 64
65 listeners: { 65 listeners: {
66 'sideNav.iron-activate': 'onIronActivate_', 66 'sideNav.iron-activate': 'onIronActivate_',
67 }, 67 },
68 68
69 /** @override */
70 ready: function() {
71 this.$$('cr-toolbar').addEventListener('search-changed', function(e) {
72 this.$$('settings-main').searchContents(e.detail);
73 }.bind(this));
74
75 window.addEventListener('popstate', function(e) {
76 this.$$('app-drawer').close();
77 }.bind(this));
78 },
79
69 /** @private */ 80 /** @private */
70 onCloseAppealTap_: function() { 81 onCloseAppealTap_: function() {
71 window.sessionStorage.appealClosed_ = this.appealClosed_ = true; 82 window.sessionStorage.appealClosed_ = this.appealClosed_ = true;
72 }, 83 },
73 84
74 /** 85 /**
75 * @param {Event} event 86 * @param {Event} event
76 * @private 87 * @private
77 */ 88 */
78 onIronActivate_: function(event) { 89 onIronActivate_: function(event) {
79 if (event.detail.item.id != 'advancedPage') 90 if (event.detail.item.id != 'advancedPage')
80 this.$$('app-drawer').close(); 91 this.$$('app-drawer').close();
81 }, 92 },
82 93
83 /** @private */ 94 /** @private */
84 onMenuButtonTap_: function() { 95 onMenuButtonTap_: function() {
85 this.$$('app-drawer').toggle(); 96 this.$$('app-drawer').toggle();
86 }, 97 },
87 98
88 /** @override */
89 ready: function() {
90 this.$$('cr-toolbar').addEventListener('search-changed', function(e) {
91 this.$$('settings-main').searchContents(e.detail);
92 }.bind(this));
93 },
94
95 /** @private */ 99 /** @private */
96 directionDelegateChanged_: function() { 100 directionDelegateChanged_: function() {
97 this.$$('app-drawer').align = this.directionDelegate.isRtl() ? 101 this.$$('app-drawer').align = this.directionDelegate.isRtl() ?
98 'right' : 'left'; 102 'right' : 'left';
99 }, 103 },
100 }); 104 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698