OLD | NEW |
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 Loading... |
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 Loading... |
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 }); |
OLD | NEW |