OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 27 matching lines...) Expand all Loading... |
38 */ | 38 */ |
39 this._proxyElement; | 39 this._proxyElement; |
40 this._proxyElementDisplay = 'inline-block'; | 40 this._proxyElementDisplay = 'inline-block'; |
41 this._autocompletionTimeout = UI.TextPrompt.DefaultAutocompletionTimeout; | 41 this._autocompletionTimeout = UI.TextPrompt.DefaultAutocompletionTimeout; |
42 this._title = ''; | 42 this._title = ''; |
43 this._queryRange = null; | 43 this._queryRange = null; |
44 this._previousText = ''; | 44 this._previousText = ''; |
45 this._currentSuggestion = ''; | 45 this._currentSuggestion = ''; |
46 this._completionRequestId = 0; | 46 this._completionRequestId = 0; |
47 this._ghostTextElement = createElementWithClass('span', 'auto-complete-text'
); | 47 this._ghostTextElement = createElementWithClass('span', 'auto-complete-text'
); |
| 48 this._ghostTextElement.setAttribute('contenteditable', 'false'); |
48 } | 49 } |
49 | 50 |
50 /** | 51 /** |
51 * @param {(function(string, string, boolean=):!Promise<!UI.SuggestBox.Suggest
ions>)} completions | 52 * @param {(function(string, string, boolean=):!Promise<!UI.SuggestBox.Suggest
ions>)} completions |
52 * @param {string=} stopCharacters | 53 * @param {string=} stopCharacters |
53 */ | 54 */ |
54 initialize(completions, stopCharacters) { | 55 initialize(completions, stopCharacters) { |
55 this._loadCompletions = completions; | 56 this._loadCompletions = completions; |
56 this._completionStopCharacters = stopCharacters || ' =:[({;,!+-*/&|^<>.'; | 57 this._completionStopCharacters = stopCharacters || ' =:[({;,!+-*/&|^<>.'; |
57 } | 58 } |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 return this._proxyElement || null; | 630 return this._proxyElement || null; |
630 } | 631 } |
631 }; | 632 }; |
632 | 633 |
633 UI.TextPrompt.DefaultAutocompletionTimeout = 250; | 634 UI.TextPrompt.DefaultAutocompletionTimeout = 250; |
634 | 635 |
635 /** @enum {symbol} */ | 636 /** @enum {symbol} */ |
636 UI.TextPrompt.Events = { | 637 UI.TextPrompt.Events = { |
637 TextChanged: Symbol('TextChanged') | 638 TextChanged: Symbol('TextChanged') |
638 }; | 639 }; |
OLD | NEW |