| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 cr.define('options', function() { | 5 cr.define('options', function() { |
| 6 /** @const */ var DictionaryWordsList = | 6 /** @const */ var DictionaryWordsList = |
| 7 options.dictionary_words.DictionaryWordsList; | 7 options.dictionary_words.DictionaryWordsList; |
| 8 /** @const */ var Page = cr.ui.pageManager.Page; | 8 /** @const */ var Page = cr.ui.pageManager.Page; |
| 9 /** @const */ var PageManager = cr.ui.pageManager.PageManager; | 9 /** @const */ var PageManager = cr.ui.pageManager.PageManager; |
| 10 | 10 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 this.onWordListChanged_(); | 56 this.onWordListChanged_(); |
| 57 }.bind(this); | 57 }.bind(this); |
| 58 | 58 |
| 59 this.searchField_ = $('language-dictionary-overlay-search-field'); | 59 this.searchField_ = $('language-dictionary-overlay-search-field'); |
| 60 this.searchField_.onsearch = function(e) { | 60 this.searchField_.onsearch = function(e) { |
| 61 this.wordList_.search(e.currentTarget.value); | 61 this.wordList_.search(e.currentTarget.value); |
| 62 }.bind(this); | 62 }.bind(this); |
| 63 this.searchField_.onkeydown = function(e) { | 63 this.searchField_.onkeydown = function(e) { |
| 64 // Don't propagate enter key events. Otherwise the default button will | 64 // Don't propagate enter key events. Otherwise the default button will |
| 65 // activate. | 65 // activate. |
| 66 if (e.keyIdentifier == 'Enter') | 66 if (e.key == 'Enter') |
| 67 e.stopPropagation(); | 67 e.stopPropagation(); |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 this.noMatchesLabel_ = getRequiredElement( | 70 this.noMatchesLabel_ = getRequiredElement( |
| 71 'language-dictionary-overlay-no-matches'); | 71 'language-dictionary-overlay-no-matches'); |
| 72 | 72 |
| 73 $('language-dictionary-overlay-done-button').onclick = function(e) { | 73 $('language-dictionary-overlay-done-button').onclick = function(e) { |
| 74 PageManager.closeOverlay(); | 74 PageManager.closeOverlay(); |
| 75 }; | 75 }; |
| 76 }, | 76 }, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 EditDictionaryOverlay.getWordListForTesting = function() { | 110 EditDictionaryOverlay.getWordListForTesting = function() { |
| 111 return EditDictionaryOverlay.getInstance().wordList_; | 111 return EditDictionaryOverlay.getInstance().wordList_; |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 return { | 114 return { |
| 115 EditDictionaryOverlay: EditDictionaryOverlay | 115 EditDictionaryOverlay: EditDictionaryOverlay |
| 116 }; | 116 }; |
| 117 }); | 117 }); |
| OLD | NEW |