| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 ArrayDataModel = cr.ui.ArrayDataModel; | 6 const ArrayDataModel = cr.ui.ArrayDataModel; |
| 7 const List = cr.ui.List; | 7 const List = cr.ui.List; |
| 8 const ListItem = cr.ui.ListItem; | 8 const ListItem = cr.ui.ListItem; |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 }, | 166 }, |
| 167 | 167 |
| 168 /** | 168 /** |
| 169 * Detaches the autocomplete popup from its current input element, if any. | 169 * Detaches the autocomplete popup from its current input element, if any. |
| 170 */ | 170 */ |
| 171 detach: function() { | 171 detach: function() { |
| 172 var input = this.targetInput_ | 172 var input = this.targetInput_ |
| 173 if (!input) | 173 if (!input) |
| 174 return; | 174 return; |
| 175 | 175 |
| 176 input.removeEventListener('keydown', this.textFieldKeyHandler_); | 176 input.removeEventListener('keydown', this.textFieldKeyHandler_, true); |
| 177 input.removeEventListener('input', this.textFieldInputHandler_); | 177 input.removeEventListener('input', this.textFieldInputHandler_); |
| 178 this.targetInput_ = null; | 178 this.targetInput_ = null; |
| 179 this.suggestions = []; | 179 this.suggestions = []; |
| 180 }, | 180 }, |
| 181 | 181 |
| 182 /** | 182 /** |
| 183 * Makes sure that the suggestion list matches the width of the input it is. | 183 * Makes sure that the suggestion list matches the width of the input it is. |
| 184 * attached to. Should be called any time the input is resized. | 184 * attached to. Should be called any time the input is resized. |
| 185 */ | 185 */ |
| 186 syncWidthToInput: function() { | 186 syncWidthToInput: function() { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 event.preventDefault(); | 230 event.preventDefault(); |
| 231 event.stopPropagation(); | 231 event.stopPropagation(); |
| 232 } | 232 } |
| 233 }, | 233 }, |
| 234 }; | 234 }; |
| 235 | 235 |
| 236 return { | 236 return { |
| 237 AutocompleteList: AutocompleteList | 237 AutocompleteList: AutocompleteList |
| 238 }; | 238 }; |
| 239 }); | 239 }); |
| OLD | NEW |