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

Unified Diff: Source/devtools/front_end/console/ConsoleView.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
« no previous file with comments | « Source/devtools/front_end/components/FlameChart.js ('k') | Source/devtools/front_end/elements/Spectrum.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/console/ConsoleView.js
diff --git a/Source/devtools/front_end/console/ConsoleView.js b/Source/devtools/front_end/console/ConsoleView.js
index 01ff99e265ad73d93ab252671e0094c9d528b36f..ab4728eee81e860d5444dbaaa444c934f419397b 100644
--- a/Source/devtools/front_end/console/ConsoleView.js
+++ b/Source/devtools/front_end/console/ConsoleView.js
@@ -73,10 +73,7 @@ WebInspector.ConsoleView = function(hideContextSelector)
this._preserveLogCheckbox.element.title = WebInspector.UIString("Do not clear log on page reload / navigation.");
var statusBarElement = this._contentsElement.createChild("div", "console-status-bar");
- statusBarElement.appendChild(this._clearConsoleButton.element);
- statusBarElement.appendChild(this._filterBar.filterButton().element);
- statusBarElement.appendChild(this._executionContextSelector.element);
- statusBarElement.appendChild(this._preserveLogCheckbox.element);
+ statusBarElement.appendChildren(this._clearConsoleButton.element, this._filterBar.filterButton().element, this._executionContextSelector.element, this._preserveLogCheckbox.element);
this._filtersContainer = this._contentsElement.createChild("div", "console-filters-header hidden");
this._filtersContainer.appendChild(this._filterBar.filtersElement());
@@ -86,8 +83,7 @@ WebInspector.ConsoleView = function(hideContextSelector)
this._viewport = new WebInspector.ViewportControl(this);
this._viewport.setStickToBottom(true);
- this._viewport.contentElement().classList.add("console-group");
- this._viewport.contentElement().classList.add("console-group-messages");
+ this._viewport.contentElement().classList.add("console-group", "console-group-messages");
this._contentsElement.appendChild(this._viewport.element);
this._messagesElement = this._viewport.element;
this._messagesElement.id = "console-messages";
@@ -109,7 +105,6 @@ WebInspector.ConsoleView = function(hideContextSelector)
this._promptElement = this._messagesElement.createChild("div", "source-code");
this._promptElement.id = "console-prompt";
this._promptElement.spellcheck = false;
- this._messagesElement.appendChild(this._promptElement);
this._showAllMessagesCheckbox = new WebInspector.StatusBarCheckbox(WebInspector.UIString("Show all messages"));
this._showAllMessagesCheckbox.inputElement.checked = true;
@@ -1117,9 +1112,8 @@ WebInspector.ConsoleCommand.prototype = {
contentElement: function()
{
if (!this._element) {
- this._element = document.createElement("div");
+ this._element = document.createElementWithClass("div", "console-user-command");
this._element.message = this;
- this._element.className = "console-user-command";
this._formatCommand();
this._element.appendChild(this._formattedCommand);
@@ -1129,8 +1123,7 @@ WebInspector.ConsoleCommand.prototype = {
_formatCommand: function()
{
- this._formattedCommand = document.createElement("span");
- this._formattedCommand.className = "console-message-text source-code";
+ this._formattedCommand = document.createElementWithClass("span", "console-message-text source-code");
this._formattedCommand.textContent = this.text;
},
« no previous file with comments | « Source/devtools/front_end/components/FlameChart.js ('k') | Source/devtools/front_end/elements/Spectrum.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698