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

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

Issue 2111223002: [MD settings] set route on advanced page toggle (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-main' displays the selected settings page. 7 * 'settings-main' displays the selected settings page.
8 */ 8 */
9 Polymer({ 9 Polymer({
10 is: 'settings-main', 10 is: 'settings-main',
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 created: function() { 62 created: function() {
63 /** @private {!PromiseResolver} */ 63 /** @private {!PromiseResolver} */
64 this.resolver_ = new PromiseResolver; 64 this.resolver_ = new PromiseResolver;
65 settings.main.rendered = this.resolver_.promise; 65 settings.main.rendered = this.resolver_.promise;
66 }, 66 },
67 67
68 attached: function() { 68 attached: function() {
69 document.addEventListener('toggle-advanced-page', function(e) { 69 document.addEventListener('toggle-advanced-page', function(e) {
70 this.showAdvancedPage_ = e.detail; 70 this.showAdvancedPage_ = e.detail;
71 this.isAdvancedMenuOpen_ = e.detail; 71 this.isAdvancedMenuOpen_ = e.detail;
72 this.currentRoute = {
73 page: this.isAdvancedMenuOpen_ ? 'advanced' : 'basic',
74 section: '',
75 subpage: [],
76 url: '',
Dan Beam 2016/06/30 23:40:26 where'd we land on omitting the url key as I asked
dschuyler 2016/07/01 00:59:05 Done.
77 };
72 if (this.showAdvancedPage_) { 78 if (this.showAdvancedPage_) {
73 doWhenReady( 79 doWhenReady(
74 function() { 80 function() {
75 var advancedPage = this.$$('settings-advanced-page'); 81 var advancedPage = this.$$('settings-advanced-page');
76 return !!advancedPage && advancedPage.scrollHeight > 0; 82 return !!advancedPage && advancedPage.scrollHeight > 0;
77 }.bind(this), 83 }.bind(this),
78 function() { 84 function() {
79 this.$$('#toggleContainer').scrollIntoView(); 85 this.$$('#toggleContainer').scrollIntoView();
80 }.bind(this)); 86 }.bind(this));
81 } 87 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 newRoute.page == 'advanced'; 124 newRoute.page == 'advanced';
119 125
120 this.style.height = isSubpage ? '100%' : ''; 126 this.style.height = isSubpage ? '100%' : '';
121 }, 127 },
122 128
123 /** @private */ 129 /** @private */
124 toggleAdvancedPage_: function() { 130 toggleAdvancedPage_: function() {
125 this.fire('toggle-advanced-page', !this.isAdvancedMenuOpen_); 131 this.fire('toggle-advanced-page', !this.isAdvancedMenuOpen_);
126 }, 132 },
127 }); 133 });
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