| Index: chrome/browser/resources/settings/languages_page/edit_dictionary_page.js
|
| diff --git a/chrome/browser/resources/settings/languages_page/edit_dictionary_page.js b/chrome/browser/resources/settings/languages_page/edit_dictionary_page.js
|
| index 7dc1b199e61562f06e01337242f5b6bd1fbc4d33..421e78056ef2aadfda373c505ada3e9ee8c781a6 100644
|
| --- a/chrome/browser/resources/settings/languages_page/edit_dictionary_page.js
|
| +++ b/chrome/browser/resources/settings/languages_page/edit_dictionary_page.js
|
| @@ -10,6 +10,9 @@ Polymer({
|
| is: 'settings-edit-dictionary-page',
|
|
|
| properties: {
|
| + /** @private {string} */
|
| + newWordValue_: String,
|
| +
|
| /** @private {!Array<string>} */
|
| words_: {
|
| type: Array,
|
| @@ -32,6 +35,16 @@ Polymer({
|
| },
|
|
|
| /**
|
| + * Check if the new word text-field is empty.
|
| + * @private
|
| + * @param {string} value
|
| + * @return {boolean} true if value is empty, false otherwise.
|
| + */
|
| + validateWord_: function(value) {
|
| + return !!value.trim();
|
| + },
|
| +
|
| + /**
|
| * Handles updates to the word list. Additions triggered by this element are
|
| * de-duped so the word list remains a set. Words are appended to the end
|
| * instead of re-sorting the list so it's clear what words were added.
|
| @@ -82,8 +95,8 @@ Polymer({
|
| */
|
| addWordFromInput_: function() {
|
| // Spaces are allowed, but removing leading and trailing whitespace.
|
| - var word = this.$.newWord.value.trim();
|
| - this.$.newWord.value = '';
|
| + var word = this.newWordValue_.trim();
|
| + this.newWordValue_ = '';
|
| if (!word)
|
| return;
|
|
|
|
|