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

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

Issue 2615933002: DevTools: Don't show blank placeholder in TextPrompt (Closed)
Patch Set: Created 3 years, 11 months 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 | « no previous file | third_party/WebKit/Source/devtools/front_end/ui/textPrompt.css » ('j') | 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 setTitle(title) { 193 setTitle(title) {
194 this._title = title; 194 this._title = title;
195 if (this._proxyElement) 195 if (this._proxyElement)
196 this._proxyElement.title = title; 196 this._proxyElement.title = title;
197 } 197 }
198 198
199 /** 199 /**
200 * @param {string} placeholder 200 * @param {string} placeholder
201 */ 201 */
202 setPlaceholder(placeholder) { 202 setPlaceholder(placeholder) {
203 this._element.setAttribute('data-placeholder', placeholder); 203 if (placeholder)
204 this._element.setAttribute('data-placeholder', placeholder);
205 else
206 this._element.removeAttribute('data-placeholder');
204 } 207 }
205 208
206 _removeFromElement() { 209 _removeFromElement() {
207 this.clearAutocomplete(); 210 this.clearAutocomplete();
208 this._element.removeEventListener('keydown', this._boundOnKeyDown, false); 211 this._element.removeEventListener('keydown', this._boundOnKeyDown, false);
209 this._element.removeEventListener('input', this._boundOnInput, false); 212 this._element.removeEventListener('input', this._boundOnInput, false);
210 this._element.removeEventListener('selectstart', this._boundClearAutocomplet e, false); 213 this._element.removeEventListener('selectstart', this._boundClearAutocomplet e, false);
211 this._element.removeEventListener('blur', this._boundClearAutocomplete, fals e); 214 this._element.removeEventListener('blur', this._boundClearAutocomplete, fals e);
212 this._element.ownerDocument.defaultView.removeEventListener('resize', this._ boundClearAutocomplete, false); 215 this._element.ownerDocument.defaultView.removeEventListener('resize', this._ boundClearAutocomplete, false);
213 if (this._isEditing) 216 if (this._isEditing)
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 } 638 }
636 }; 639 };
637 640
638 UI.TextPrompt.DefaultAutocompletionTimeout = 250; 641 UI.TextPrompt.DefaultAutocompletionTimeout = 250;
639 642
640 /** @enum {symbol} */ 643 /** @enum {symbol} */
641 UI.TextPrompt.Events = { 644 UI.TextPrompt.Events = {
642 ItemApplied: Symbol('text-prompt-item-applied'), 645 ItemApplied: Symbol('text-prompt-item-applied'),
643 ItemAccepted: Symbol('text-prompt-item-accepted') 646 ItemAccepted: Symbol('text-prompt-item-accepted')
644 }; 647 };
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/ui/textPrompt.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698