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

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

Issue 2127723003: [MD settings] do not scroll when toggling advanced menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge with master 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
« ash/shelf/app_list_button.cc ('K') | « ash/shelf/app_list_button.cc ('k') | 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 = { 72 this.currentRoute = {
73 page: this.isAdvancedMenuOpen_ ? 'advanced' : 'basic', 73 page: this.isAdvancedMenuOpen_ ? 'advanced' : 'basic',
74 section: '', 74 section: '',
75 subpage: [], 75 subpage: [],
76 }; 76 };
77 if (this.showAdvancedPage_) {
78 doWhenReady(
79 function() {
80 var advancedPage = this.$$('settings-advanced-page');
81 return !!advancedPage && advancedPage.scrollHeight > 0;
82 }.bind(this),
83 function() {
84 this.$$('#toggleContainer').scrollIntoView();
85 }.bind(this));
86 }
87 }.bind(this)); 77 }.bind(this));
88 78
89 doWhenReady( 79 doWhenReady(
90 function() { 80 function() {
91 var basicPage = this.$$('settings-basic-page'); 81 var basicPage = this.$$('settings-basic-page');
92 return !!basicPage && basicPage.scrollHeight > 0; 82 return !!basicPage && basicPage.scrollHeight > 0;
93 }.bind(this), 83 }.bind(this),
94 function() { 84 function() {
95 this.resolver_.resolve(); 85 this.resolver_.resolve();
96 }.bind(this)); 86 }.bind(this));
(...skipping 26 matching lines...) Expand all
123 newRoute.page == 'advanced'; 113 newRoute.page == 'advanced';
124 114
125 this.style.height = isSubpage ? '100%' : ''; 115 this.style.height = isSubpage ? '100%' : '';
126 }, 116 },
127 117
128 /** @private */ 118 /** @private */
129 toggleAdvancedPage_: function() { 119 toggleAdvancedPage_: function() {
130 this.fire('toggle-advanced-page', !this.isAdvancedMenuOpen_); 120 this.fire('toggle-advanced-page', !this.isAdvancedMenuOpen_);
131 }, 121 },
132 }); 122 });
OLDNEW
« ash/shelf/app_list_button.cc ('K') | « ash/shelf/app_list_button.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698