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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/elements/ClassesPaneWidget.js

Issue 2924883002: DevTools: migrate SSP Classes and ElementState toolbar widgets to shadow (Closed)
Patch Set: Created 3 years, 6 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
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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 * @unrestricted 5 * @unrestricted
6 */ 6 */
7 Elements.ClassesPaneWidget = class extends UI.Widget { 7 Elements.ClassesPaneWidget = class extends UI.Widget {
8 constructor() { 8 constructor() {
9 super(); 9 super(true);
10 this.element.className = 'styles-element-classes-pane'; 10 this.registerRequiredCSS('elements/classesPaneWidget.css');
11 var container = this.element.createChild('div', 'title-container'); 11 this.contentElement.className = 'styles-element-classes-pane';
12 var container = this.contentElement.createChild('div', 'title-container');
12 this._input = container.createChild('div', 'new-class-input monospace'); 13 this._input = container.createChild('div', 'new-class-input monospace');
13 this.setDefaultFocusedElement(this._input); 14 this.setDefaultFocusedElement(this._input);
14 this._classesContainer = this.element.createChild('div', 'source-code'); 15 this._classesContainer = this.contentElement.createChild('div', 'source-code ');
15 this._classesContainer.classList.add('styles-element-classes-container'); 16 this._classesContainer.classList.add('styles-element-classes-container');
16 this._prompt = new Elements.ClassesPaneWidget.ClassNamePrompt(); 17 this._prompt = new Elements.ClassesPaneWidget.ClassNamePrompt();
17 this._prompt.setAutocompletionTimeout(0); 18 this._prompt.setAutocompletionTimeout(0);
18 this._prompt.renderAsBlock(); 19 this._prompt.renderAsBlock();
19 20
20 var proxyElement = this._prompt.attach(this._input); 21 var proxyElement = this._prompt.attach(this._input);
21 this._prompt.setPlaceholder(Common.UIString('Add new class')); 22 this._prompt.setPlaceholder(Common.UIString('Add new class'));
22 this._prompt.addEventListener(UI.TextPrompt.Events.TextChanged, this._onText Changed, this); 23 this._prompt.addEventListener(UI.TextPrompt.Events.TextChanged, this._onText Changed, this);
23 proxyElement.addEventListener('keydown', this._onKeyDown.bind(this), false); 24 proxyElement.addEventListener('keydown', this._onKeyDown.bind(this), false);
24 25
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 if (!this._classNamesPromise || this._selectedFrameId !== selectedNode.frame Id()) 312 if (!this._classNamesPromise || this._selectedFrameId !== selectedNode.frame Id())
312 this._classNamesPromise = this._getClassNames(selectedNode); 313 this._classNamesPromise = this._getClassNames(selectedNode);
313 314
314 return this._classNamesPromise.then(completions => { 315 return this._classNamesPromise.then(completions => {
315 if (prefix[0] === '.') 316 if (prefix[0] === '.')
316 completions = completions.map(value => '.' + value); 317 completions = completions.map(value => '.' + value);
317 return completions.filter(value => value.startsWith(prefix)).map(completio n => ({text: completion})); 318 return completions.filter(value => value.startsWith(prefix)).map(completio n => ({text: completion}));
318 }); 319 });
319 } 320 }
320 }; 321 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698