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

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: use offsetTop 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 Polymer.RenderStatus.afterNextRender(this, function() {
65 this.$.otherEngines.scrollOffset = this.$.otherEngines.offsetTop;
66 });
62 }, 67 },
63 68
64 /** @private */ 69 /** @private */
65 extensionsChanged_: function() { 70 extensionsChanged_: function() {
66 if (this.showExtensionsList_ && this.$.extensions) 71 if (this.showExtensionsList_ && this.$.extensions)
67 this.$.extensions.notifyResize(); 72 this.$.extensions.notifyResize();
68 }, 73 },
69 74
70 /** 75 /**
71 * @param {!SearchEnginesInfo} searchEnginesInfo 76 * @param {!SearchEnginesInfo} searchEnginesInfo
(...skipping 22 matching lines...) Expand all
94 this.$.addSearchEngine.focus(); 99 this.$.addSearchEngine.focus();
95 }.bind(this)); 100 }.bind(this));
96 }.bind(this)); 101 }.bind(this));
97 }, 102 },
98 103
99 /** @private */ 104 /** @private */
100 computeShowExtensionsList_: function() { 105 computeShowExtensionsList_: function() {
101 return this.extensions.length > 0; 106 return this.extensions.length > 0;
102 }, 107 },
103 }); 108 });
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