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

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

Issue 2805213003: MD Settings: make iron list offset so items render onscreen (Closed)
Patch Set: Created 3 years, 8 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 | « chrome/browser/resources/settings/search_engines_page/search_engines_page.html ('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 'settings-search-engines-page' is the settings page 6 * @fileoverview 'settings-search-engines-page' is the settings page
7 * containing search engines settings. 7 * containing search engines settings.
8 */ 8 */
9 Polymer({ 9 Polymer({
10 is: 'settings-search-engines-page', 10 is: 'settings-search-engines-page',
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 // Since the iron-list for extensions is enclosed in a dom-if, observe both 52 // Since the iron-list for extensions is enclosed in a dom-if, observe both
53 // |extensions| and |showExtensionsList_|. 53 // |extensions| and |showExtensionsList_|.
54 observers: ['extensionsChanged_(extensions, showExtensionsList_)'], 54 observers: ['extensionsChanged_(extensions, showExtensionsList_)'],
55 55
56 /** @override */ 56 /** @override */
57 ready: function() { 57 ready: function() {
58 settings.SearchEnginesBrowserProxyImpl.getInstance(). 58 settings.SearchEnginesBrowserProxyImpl.getInstance().
59 getSearchEnginesList().then(this.enginesChanged_.bind(this)); 59 getSearchEnginesList().then(this.enginesChanged_.bind(this));
60 this.addWebUIListener( 60 this.addWebUIListener(
61 'search-engines-changed', this.enginesChanged_.bind(this)); 61 'search-engines-changed', this.enginesChanged_.bind(this));
62
63 // Sets offset in iron-list that uses the page as a scrollTarget.
64 // The scrollTarget doesn't know about headers and items above the list.
65 Polymer.RenderStatus.afterNextRender(this, function() {
66 // Size of headers is constant, but defaultEngines size can vary.
67 this.$.otherEngines.scrollOffset = 184 +
Dan Beam 2017/04/07 23:32:53 this looks brittle, where does the 184 come from?
hcarmona 2017/04/08 00:02:01 Agreed, for parts that are in this file, I can add
Dan Beam 2017/04/08 00:09:44 offsetTop
hcarmona 2017/04/08 00:24:40 Sweet. Done.
68 this.$.defaultEngines.getBoundingClientRect().height;
69 });
62 }, 70 },
63 71
64 /** @private */ 72 /** @private */
65 extensionsChanged_: function() { 73 extensionsChanged_: function() {
66 if (this.showExtensionsList_ && this.$.extensions) 74 if (this.showExtensionsList_ && this.$.extensions)
67 this.$.extensions.notifyResize(); 75 this.$.extensions.notifyResize();
68 }, 76 },
69 77
70 /** 78 /**
71 * @param {!SearchEnginesInfo} searchEnginesInfo 79 * @param {!SearchEnginesInfo} searchEnginesInfo
(...skipping 22 matching lines...) Expand all
94 this.$.addSearchEngine.focus(); 102 this.$.addSearchEngine.focus();
95 }.bind(this)); 103 }.bind(this));
96 }.bind(this)); 104 }.bind(this));
97 }, 105 },
98 106
99 /** @private */ 107 /** @private */
100 computeShowExtensionsList_: function() { 108 computeShowExtensionsList_: function() {
101 return this.extensions.length > 0; 109 return this.extensions.length > 0;
102 }, 110 },
103 }); 111 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/search_engines_page/search_engines_page.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698