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

Unified Diff: Source/devtools/front_end/ui/SettingsUI.js

Issue 367093003: DevTools: More code reduce via using document.createElementWithClass and document.createChild. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/ui/SettingsUI.js
diff --git a/Source/devtools/front_end/ui/SettingsUI.js b/Source/devtools/front_end/ui/SettingsUI.js
index 03f6748b46f0faf05bdbaba2e36ad1c93799ffec..c2b17375ff12dcbebde11fb853eed87e3b4a0675 100644
--- a/Source/devtools/front_end/ui/SettingsUI.js
+++ b/Source/devtools/front_end/ui/SettingsUI.js
@@ -115,10 +115,8 @@ WebInspector.SettingsUI.createSettingInputField = function(label, setting, numer
inputElement.addEventListener("keydown", onKeyDown, false);
var errorMessageLabel;
- if (validatorCallback) {
- errorMessageLabel = p.createChild("div");
- errorMessageLabel.classList.add("field-error-message");
- }
+ if (validatorCallback)
+ errorMessageLabel = p.createChild("div", "field-error-message");
function onInput()
{
@@ -180,10 +178,9 @@ WebInspector.SettingsUI.createSettingInputField = function(label, setting, numer
WebInspector.SettingsUI.createCustomSetting = function(name, element)
{
var p = document.createElement("p");
- var fieldsetElement = document.createElement("fieldset");
+ var fieldsetElement = p.createChild("fieldset");
fieldsetElement.createChild("label").textContent = name;
fieldsetElement.appendChild(element);
- p.appendChild(fieldsetElement);
return p;
}
« no previous file with comments | « Source/devtools/front_end/ui/ProgressIndicator.js ('k') | Source/devtools/front_end/ui/SidebarTreeElement.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698