OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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-add-languages-dialog' is a dialog for enabling | 6 * @fileoverview 'settings-add-languages-dialog' is a dialog for enabling |
7 * languages. | 7 * languages. |
8 */ | 8 */ |
9 Polymer({ | 9 Polymer({ |
10 is: 'settings-add-languages-dialog', | 10 is: 'settings-add-languages-dialog', |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 /** @private */ | 28 /** @private */ |
29 disableActionButton_: { | 29 disableActionButton_: { |
30 type: Boolean, | 30 type: Boolean, |
31 value: true, | 31 value: true, |
32 }, | 32 }, |
33 }, | 33 }, |
34 | 34 |
35 attached: function() { | 35 attached: function() { |
36 this.$.dialog.showModal(); | 36 this.$.dialog.showModal(); |
| 37 // Fire iron-resize after the list initially displays to prevent flickering. |
| 38 setTimeout(function() { |
| 39 this.$$('iron-list').fire('iron-resize'); |
| 40 }.bind(this)); |
37 }, | 41 }, |
38 | 42 |
39 /** | 43 /** |
40 * Returns the supported languages that are not yet enabled, based on | 44 * Returns the supported languages that are not yet enabled, based on |
41 * the LanguageHelper's enabled languages list. | 45 * the LanguageHelper's enabled languages list. |
42 * @param {!Array<!chrome.languageSettingsPrivate.Language>} | 46 * @param {!Array<!chrome.languageSettingsPrivate.Language>} |
43 * supportedLanguages | 47 * supportedLanguages |
44 * @param {!Object} enabledLanguagesChange Polymer change record for | 48 * @param {!Object} enabledLanguagesChange Polymer change record for |
45 * |enabledLanguages|. | 49 * |enabledLanguages|. |
46 * @return {!Array<!chrome.languageSettingsPrivate.Language>} | 50 * @return {!Array<!chrome.languageSettingsPrivate.Language>} |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 /** | 93 /** |
90 * Enables the checked languages. | 94 * Enables the checked languages. |
91 * @private | 95 * @private |
92 */ | 96 */ |
93 onActionButtonTap_: function() { | 97 onActionButtonTap_: function() { |
94 this.$.dialog.close(); | 98 this.$.dialog.close(); |
95 for (var languageCode of this.languagesToAdd_) | 99 for (var languageCode of this.languagesToAdd_) |
96 this.languageHelper.enableLanguage(languageCode); | 100 this.languageHelper.enableLanguage(languageCode); |
97 }, | 101 }, |
98 }); | 102 }); |
OLD | NEW |