| OLD | NEW |
| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 if (!node) | 91 if (!node) |
| 92 return; | 92 return; |
| 93 | 93 |
| 94 var classes = this._nodeClasses(node); | 94 var classes = this._nodeClasses(node); |
| 95 var keys = classes.keysArray(); | 95 var keys = classes.keysArray(); |
| 96 keys.sort(String.caseInsensetiveComparator); | 96 keys.sort(String.caseInsensetiveComparator); |
| 97 for (var i = 0; i < keys.length; ++i) { | 97 for (var i = 0; i < keys.length; ++i) { |
| 98 var className = keys[i]; | 98 var className = keys[i]; |
| 99 var label = UI.createCheckboxLabel(className, classes.get(className)); | 99 var label = UI.createCheckboxLabel(className, classes.get(className)); |
| 100 label.visualizeFocus = true; | |
| 101 label.classList.add('monospace'); | 100 label.classList.add('monospace'); |
| 102 label.checkboxElement.addEventListener('click', this._onClick.bind(this, c
lassName), false); | 101 label.checkboxElement.addEventListener('click', this._onClick.bind(this, c
lassName), false); |
| 103 this._classesContainer.appendChild(label); | 102 this._classesContainer.appendChild(label); |
| 104 } | 103 } |
| 105 } | 104 } |
| 106 | 105 |
| 107 /** | 106 /** |
| 108 * @param {string} className | 107 * @param {string} className |
| 109 * @param {!Event} event | 108 * @param {!Event} event |
| 110 */ | 109 */ |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 if (!this._classNamesPromise || this._selectedFrameId !== selectedNode.frame
Id()) | 254 if (!this._classNamesPromise || this._selectedFrameId !== selectedNode.frame
Id()) |
| 256 this._classNamesPromise = this._getClassNames(selectedNode); | 255 this._classNamesPromise = this._getClassNames(selectedNode); |
| 257 | 256 |
| 258 return this._classNamesPromise.then(completions => { | 257 return this._classNamesPromise.then(completions => { |
| 259 if (prefix[0] === '.') | 258 if (prefix[0] === '.') |
| 260 completions = completions.map(value => '.' + value); | 259 completions = completions.map(value => '.' + value); |
| 261 return completions.filter(value => value.startsWith(prefix)).map(completio
n => ({text: completion})); | 260 return completions.filter(value => value.startsWith(prefix)).map(completio
n => ({text: completion})); |
| 262 }); | 261 }); |
| 263 } | 262 } |
| 264 }; | 263 }; |
| OLD | NEW |