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

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

Issue 362273002: DevTools: Reduce code via using document.createElementWithClass and document.createChild. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/devtools/front_end/ui/Popover.js ('k') | Source/devtools/front_end/ui/View.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 18 matching lines...) Expand all
29 /** 29 /**
30 * @constructor 30 * @constructor
31 * @extends {WebInspector.View} 31 * @extends {WebInspector.View}
32 */ 32 */
33 WebInspector.SidebarPane = function(title) 33 WebInspector.SidebarPane = function(title)
34 { 34 {
35 WebInspector.View.call(this); 35 WebInspector.View.call(this);
36 this.setMinimumSize(25, 0); 36 this.setMinimumSize(25, 0);
37 this.element.className = "sidebar-pane"; // Override 37 this.element.className = "sidebar-pane"; // Override
38 38
39 this.titleElement = document.createElement("div"); 39 this.titleElement = document.createElementWithClass("div", "sidebar-pane-too lbar");
40 this.titleElement.className = "sidebar-pane-toolbar";
41
42 this.bodyElement = this.element.createChild("div", "body"); 40 this.bodyElement = this.element.createChild("div", "body");
43
44 this._title = title; 41 this._title = title;
45
46 this._expandCallback = null; 42 this._expandCallback = null;
47 } 43 }
48 44
49 WebInspector.SidebarPane.EventTypes = { 45 WebInspector.SidebarPane.EventTypes = {
50 wasShown: "wasShown" 46 wasShown: "wasShown"
51 } 47 }
52 48
53 WebInspector.SidebarPane.prototype = { 49 WebInspector.SidebarPane.prototype = {
54 /** 50 /**
55 * @return {string} 51 * @return {string}
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 { 194 {
199 var title = pane.title(); 195 var title = pane.title();
200 this.appendTab(title, title, pane); 196 this.appendTab(title, title, pane);
201 pane.element.appendChild(pane.titleElement); 197 pane.element.appendChild(pane.titleElement);
202 pane.setExpandCallback(this.selectTab.bind(this, title)); 198 pane.setExpandCallback(this.selectTab.bind(this, title));
203 199
204 }, 200 },
205 201
206 __proto__: WebInspector.TabbedPane.prototype 202 __proto__: WebInspector.TabbedPane.prototype
207 } 203 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/ui/Popover.js ('k') | Source/devtools/front_end/ui/View.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698