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

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

Issue 2776263006: [DevTools] Migrate checkbox label to a proper web component (Closed)
Patch Set: 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
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.ElementStatePaneWidget = class extends UI.Widget { 7 Elements.ElementStatePaneWidget = class extends UI.Widget {
8 constructor() { 8 constructor() {
9 super(); 9 super();
10 this.element.className = 'styles-element-state-pane'; 10 this.element.className = 'styles-element-state-pane';
(...skipping 12 matching lines...) Expand all
23 return; 23 return;
24 SDK.CSSModel.fromNode(node).forcePseudoState(node, event.target.state, eve nt.target.checked); 24 SDK.CSSModel.fromNode(node).forcePseudoState(node, event.target.state, eve nt.target.checked);
25 } 25 }
26 26
27 /** 27 /**
28 * @param {string} state 28 * @param {string} state
29 * @return {!Element} 29 * @return {!Element}
30 */ 30 */
31 function createCheckbox(state) { 31 function createCheckbox(state) {
32 var td = createElement('td'); 32 var td = createElement('td');
33 var label = UI.createCheckboxLabel(':' + state); 33 var label = UI.CheckboxLabel.create(':' + state);
34 var input = label.checkboxElement; 34 var input = label.checkboxElement;
35 input.state = state; 35 input.state = state;
36 input.addEventListener('click', clickListener, false); 36 input.addEventListener('click', clickListener, false);
37 inputs.push(input); 37 inputs.push(input);
38 td.appendChild(label); 38 td.appendChild(label);
39 return td; 39 return td;
40 } 40 }
41 41
42 var tr = table.createChild('tr'); 42 var tr = table.createChild('tr');
43 tr.appendChild(createCheckbox.call(null, 'active')); 43 tr.appendChild(createCheckbox.call(null, 'active'));
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 } 113 }
114 114
115 /** 115 /**
116 * @override 116 * @override
117 * @return {!UI.ToolbarItem} 117 * @return {!UI.ToolbarItem}
118 */ 118 */
119 item() { 119 item() {
120 return this._button; 120 return this._button;
121 } 121 }
122 }; 122 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698