Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(551)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js

Issue 2478563002: DevTools: Substring autocomplete in Console and StylesSideBar. (Closed)
Patch Set: tests Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 };
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698