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

Side by Side Diff: Source/devtools/front_end/ui/SettingsUI.js

Issue 805853002: DevTools: Make labeled checkbox a web component (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 16 matching lines...) Expand all
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 WebInspector.SettingsUI = {} 31 WebInspector.SettingsUI = {}
32 32
33 /** 33 /**
34 * @param {string} name 34 * @param {string} name
35 * @param {!WebInspector.Setting} setting 35 * @param {!WebInspector.Setting} setting
36 * @param {boolean=} omitParagraphElement 36 * @param {boolean=} omitParagraphElement
37 * @param {!Element=} inputElement
38 * @param {string=} tooltip 37 * @param {string=} tooltip
39 * @return {!Element} 38 * @return {!Element}
40 */ 39 */
41 WebInspector.SettingsUI.createSettingCheckbox = function(name, setting, omitPara graphElement, inputElement, tooltip) 40 WebInspector.SettingsUI.createSettingCheckbox = function(name, setting, omitPara graphElement, tooltip)
42 { 41 {
43 var input = inputElement || createElement("input"); 42 var label = createCheckboxLabel(name);
44 input.type = "checkbox"; 43 if (tooltip)
44 label.title = tooltip;
45
46 var input = label.checkboxElement;
45 input.name = name; 47 input.name = name;
46 WebInspector.SettingsUI.bindCheckbox(input, setting); 48 WebInspector.SettingsUI.bindCheckbox(input, setting);
47 49
48 var label = createElement("label");
49 label.appendChild(input);
50 label.createTextChild(name);
51 if (tooltip)
52 label.title = tooltip;
53
54 if (omitParagraphElement) 50 if (omitParagraphElement)
55 return label; 51 return label;
56 52
57 var p = createElement("p"); 53 var p = createElement("p");
58 p.appendChild(label); 54 p.appendChild(label);
59 return p; 55 return p;
60 } 56 }
61 57
62 /** 58 /**
63 * @param {!Element} input 59 * @param {!Element} input
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 281
286 WebInspector.UISettingDelegate.prototype = { 282 WebInspector.UISettingDelegate.prototype = {
287 /** 283 /**
288 * @return {?Element} 284 * @return {?Element}
289 */ 285 */
290 settingElement: function() 286 settingElement: function()
291 { 287 {
292 return null; 288 return null;
293 } 289 }
294 } 290 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/ui/SearchableView.js ('k') | Source/devtools/front_end/ui/StatusBar.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698