| 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-edit-dictionary-page' is a sub-page for editing | 6 * @fileoverview 'settings-edit-dictionary-page' is a sub-page for editing |
| 7 * the "dictionary" of custom words used for spell check. | 7 * the "dictionary" of custom words used for spell check. |
| 8 */ | 8 */ |
| 9 Polymer({ | 9 Polymer({ |
| 10 is: 'settings-edit-dictionary-page', | 10 is: 'settings-edit-dictionary-page', |
| 11 | 11 |
| 12 properties: { | 12 properties: { |
| 13 /** @private {!Array<string>} */ | 13 /** @private {!Array<string>} */ |
| 14 words_: { | 14 words_: { |
| 15 type: Array, | 15 type: Array, |
| 16 value: function() { return []; }, | 16 value: function() { |
| 17 return []; |
| 18 }, |
| 17 }, | 19 }, |
| 18 }, | 20 }, |
| 19 | 21 |
| 20 ready: function() { | 22 ready: function() { |
| 21 chrome.languageSettingsPrivate.getSpellcheckWords(function(words) { | 23 chrome.languageSettingsPrivate.getSpellcheckWords(function(words) { |
| 22 this.words_ = words; | 24 this.words_ = words; |
| 23 }.bind(this)); | 25 }.bind(this)); |
| 24 | 26 |
| 25 // Updates are applied locally so they appear immediately, but we should | 27 // Updates are applied locally so they appear immediately, but we should |
| 26 // listen for changes in case they come from elsewhere. | 28 // listen for changes in case they come from elsewhere. |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 if (index == -1) { | 93 if (index == -1) { |
| 92 chrome.languageSettingsPrivate.addSpellcheckWord(word); | 94 chrome.languageSettingsPrivate.addSpellcheckWord(word); |
| 93 this.push('words_', word); | 95 this.push('words_', word); |
| 94 } | 96 } |
| 95 | 97 |
| 96 // Scroll to the word (usually the bottom, or to the index if the word | 98 // Scroll to the word (usually the bottom, or to the index if the word |
| 97 // is already present). | 99 // is already present). |
| 98 this.$.list.scrollToIndex(index); | 100 this.$.list.scrollToIndex(index); |
| 99 }, | 101 }, |
| 100 }); | 102 }); |
| OLD | NEW |