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

Unified Diff: Source/devtools/front_end/ui/TabbedPane.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/ui/SuggestBox.js ('k') | Source/devtools/front_end/ui/TextPrompt.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ui/TabbedPane.js
diff --git a/Source/devtools/front_end/ui/TabbedPane.js b/Source/devtools/front_end/ui/TabbedPane.js
index 395a3a3ec74de7dd43a325a72466cc55a6ef1327..733e9bc2cef18bf5a5ed95e1c1dc37ae52c86773 100644
--- a/Source/devtools/front_end/ui/TabbedPane.js
+++ b/Source/devtools/front_end/ui/TabbedPane.js
@@ -508,10 +508,9 @@ WebInspector.TabbedPane.prototype = {
_createDropDownButton: function()
{
- var dropDownContainer = document.createElement("div");
- dropDownContainer.classList.add("tabbed-pane-header-tabs-drop-down-container");
+ var dropDownContainer = document.createElementWithClass("div", "tabbed-pane-header-tabs-drop-down-container");
var dropDownButton = dropDownContainer.createChild("div", "tabbed-pane-header-tabs-drop-down");
- dropDownButton.appendChild(document.createTextNode("\u00bb"));
+ dropDownButton.createTextChild("\u00bb");
this._dropDownMenu = new WebInspector.DropDownMenu();
this._dropDownMenu.addEventListener(WebInspector.DropDownMenu.Events.ItemSelected, this._dropDownMenuItemSelected, this);
@@ -899,8 +898,7 @@ WebInspector.TabbedPaneTab.prototype = {
_createIconElement: function(tabElement, titleElement)
{
- var iconElement = document.createElement("span");
- iconElement.className = "tabbed-pane-header-tab-icon " + this._iconClass;
+ var iconElement = document.createElementWithClass("span", "tabbed-pane-header-tab-icon " + this._iconClass);
if (this._iconTooltip)
iconElement.title = this._iconTooltip;
tabElement.insertBefore(iconElement, titleElement);
@@ -913,8 +911,7 @@ WebInspector.TabbedPaneTab.prototype = {
*/
_createTabElement: function(measuring)
{
- var tabElement = document.createElement("div");
- tabElement.classList.add("tabbed-pane-header-tab");
+ var tabElement = document.createElementWithClass("div", "tabbed-pane-header-tab");
tabElement.id = "tab-" + this._id;
tabElement.tabIndex = -1;
tabElement.selectTabForTest = this._tabbedPane.selectTab.bind(this._tabbedPane, this.id, true);
« no previous file with comments | « Source/devtools/front_end/ui/SuggestBox.js ('k') | Source/devtools/front_end/ui/TextPrompt.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698