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

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

Issue 2741863002: DevTools: Focus background in Toolbars (Closed)
Patch Set: clean up code Created 3 years, 8 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/UIUtils.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
10 this.element.className = 'styles-element-classes-pane'; 10 this.element.className = 'styles-element-classes-pane';
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 if (!node) 95 if (!node)
96 return; 96 return;
97 97
98 var classes = this._nodeClasses(node); 98 var classes = this._nodeClasses(node);
99 var keys = classes.keysArray(); 99 var keys = classes.keysArray();
100 keys.sort(String.caseInsensetiveComparator); 100 keys.sort(String.caseInsensetiveComparator);
101 for (var i = 0; i < keys.length; ++i) { 101 for (var i = 0; i < keys.length; ++i) {
102 var className = keys[i]; 102 var className = keys[i];
103 var label = UI.CheckboxLabel.create(className, classes.get(className)); 103 var label = UI.CheckboxLabel.create(className, classes.get(className));
104 label.visualizeFocus = true;
105 label.classList.add('monospace'); 104 label.classList.add('monospace');
106 label.checkboxElement.addEventListener('click', this._onClick.bind(this, c lassName), false); 105 label.checkboxElement.addEventListener('click', this._onClick.bind(this, c lassName), false);
107 this._classesContainer.appendChild(label); 106 this._classesContainer.appendChild(label);
108 } 107 }
109 } 108 }
110 109
111 /** 110 /**
112 * @param {string} className 111 * @param {string} className
113 * @param {!Event} event 112 * @param {!Event} event
114 */ 113 */
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 if (!this._classNamesPromise || this._selectedFrameId !== selectedNode.frame Id()) 258 if (!this._classNamesPromise || this._selectedFrameId !== selectedNode.frame Id())
260 this._classNamesPromise = this._getClassNames(selectedNode); 259 this._classNamesPromise = this._getClassNames(selectedNode);
261 260
262 return this._classNamesPromise.then(completions => { 261 return this._classNamesPromise.then(completions => {
263 if (prefix[0] === '.') 262 if (prefix[0] === '.')
264 completions = completions.map(value => '.' + value); 263 completions = completions.map(value => '.' + value);
265 return completions.filter(value => value.startsWith(prefix)).map(completio n => ({text: completion})); 264 return completions.filter(value => value.startsWith(prefix)).map(completio n => ({text: completion}));
266 }); 265 });
267 } 266 }
268 }; 267 };
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698