| 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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 | 322 |
| 323 clearAutocomplete() { | 323 clearAutocomplete() { |
| 324 if (this._isSuggestBoxVisible()) | 324 if (this._isSuggestBoxVisible()) |
| 325 this._suggestBox.hide(); | 325 this._suggestBox.hide(); |
| 326 this._clearAutocompleteTimeout(); | 326 this._clearAutocompleteTimeout(); |
| 327 this._queryRange = null; | 327 this._queryRange = null; |
| 328 this._refreshGhostText(); | 328 this._refreshGhostText(); |
| 329 } | 329 } |
| 330 | 330 |
| 331 _refreshGhostText() { | 331 _refreshGhostText() { |
| 332 if (this._queryRange && this._isCaretAtEndOfPrompt()) { | 332 if (this._queryRange && this._isCaretAtEndOfPrompt() && this._currentSuggest
ion.startsWith(this.text().substring(this._queryRange.startColumn))) { |
| 333 this._ghostTextElement.textContent = | 333 this._ghostTextElement.textContent = |
| 334 this._currentSuggestion.substring(this._queryRange.endColumn - this._q
ueryRange.startColumn); | 334 this._currentSuggestion.substring(this._queryRange.endColumn - this._q
ueryRange.startColumn); |
| 335 this._element.appendChild(this._ghostTextElement); | 335 this._element.appendChild(this._ghostTextElement); |
| 336 } else { | 336 } else { |
| 337 this._ghostTextElement.remove(); | 337 this._ghostTextElement.remove(); |
| 338 } | 338 } |
| 339 } | 339 } |
| 340 | 340 |
| 341 _clearAutocompleteTimeout() { | 341 _clearAutocompleteTimeout() { |
| 342 if (this._completeTimeout) { | 342 if (this._completeTimeout) { |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 636 } | 636 } |
| 637 }; | 637 }; |
| 638 | 638 |
| 639 WebInspector.TextPrompt.DefaultAutocompletionTimeout = 250; | 639 WebInspector.TextPrompt.DefaultAutocompletionTimeout = 250; |
| 640 | 640 |
| 641 /** @enum {symbol} */ | 641 /** @enum {symbol} */ |
| 642 WebInspector.TextPrompt.Events = { | 642 WebInspector.TextPrompt.Events = { |
| 643 ItemApplied: Symbol('text-prompt-item-applied'), | 643 ItemApplied: Symbol('text-prompt-item-applied'), |
| 644 ItemAccepted: Symbol('text-prompt-item-accepted') | 644 ItemAccepted: Symbol('text-prompt-item-accepted') |
| 645 }; | 645 }; |
| OLD | NEW |