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 var list = this.$$('iron-list'); | |
39 setTimeout(list.fire.bind(list, 'iron-resize')); | |
Dan Beam
2016/09/23 23:25:42
setTimeout(function() {
this.$$('iron-list').fir
michaelpg
2016/09/28 23:24:29
Done.
| |
37 }, | 40 }, |
38 | 41 |
39 /** | 42 /** |
40 * Returns the supported languages that are not yet enabled, based on | 43 * Returns the supported languages that are not yet enabled, based on |
41 * the LanguageHelper's enabled languages list. | 44 * the LanguageHelper's enabled languages list. |
42 * @param {!Array<!chrome.languageSettingsPrivate.Language>} | 45 * @param {!Array<!chrome.languageSettingsPrivate.Language>} |
43 * supportedLanguages | 46 * supportedLanguages |
44 * @param {!Object} enabledLanguagesChange Polymer change record for | 47 * @param {!Object} enabledLanguagesChange Polymer change record for |
45 * |enabledLanguages|. | 48 * |enabledLanguages|. |
46 * @return {!Array<!chrome.languageSettingsPrivate.Language>} | 49 * @return {!Array<!chrome.languageSettingsPrivate.Language>} |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
89 /** | 92 /** |
90 * Enables the checked languages. | 93 * Enables the checked languages. |
91 * @private | 94 * @private |
92 */ | 95 */ |
93 onActionButtonTap_: function() { | 96 onActionButtonTap_: function() { |
94 this.$.dialog.close(); | 97 this.$.dialog.close(); |
95 for (var languageCode of this.languagesToAdd_) | 98 for (var languageCode of this.languagesToAdd_) |
96 this.languageHelper.enableLanguage(languageCode); | 99 this.languageHelper.enableLanguage(languageCode); |
97 }, | 100 }, |
98 }); | 101 }); |
OLD | NEW |