| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 * @param {string} className | 76 * @param {string} className |
| 77 * @param {string} title | 77 * @param {string} title |
| 78 * @param {string=} subtitle | 78 * @param {string=} subtitle |
| 79 * @param {?Object=} representedObject | 79 * @param {?Object=} representedObject |
| 80 * @param {boolean=} hasChildren | 80 * @param {boolean=} hasChildren |
| 81 */ | 81 */ |
| 82 WebInspector.SidebarTreeElement = function(className, title, subtitle, represent
edObject, hasChildren) | 82 WebInspector.SidebarTreeElement = function(className, title, subtitle, represent
edObject, hasChildren) |
| 83 { | 83 { |
| 84 TreeElement.call(this, "", representedObject, hasChildren); | 84 TreeElement.call(this, "", representedObject, hasChildren); |
| 85 | 85 |
| 86 if (hasChildren) { | 86 if (hasChildren) |
| 87 this.disclosureButton = document.createElement("button"); | 87 this.disclosureButton = document.createElementWithClass("button", "discl
osure-button"); |
| 88 this.disclosureButton.className = "disclosure-button"; | |
| 89 } | |
| 90 | 88 |
| 91 this.iconElement = document.createElementWithClass("div", "icon"); | 89 this.iconElement = document.createElementWithClass("div", "icon"); |
| 92 this.statusElement = document.createElementWithClass("div", "status"); | 90 this.statusElement = document.createElementWithClass("div", "status"); |
| 93 this.titlesElement = document.createElementWithClass("div", "titles"); | 91 this.titlesElement = document.createElementWithClass("div", "titles"); |
| 94 | 92 |
| 95 this.titleContainer = this.titlesElement.createChild("span", "title-containe
r"); | 93 this.titleContainer = this.titlesElement.createChild("span", "title-containe
r"); |
| 96 this.titleElement = this.titleContainer.createChild("span", "title"); | 94 this.titleElement = this.titleContainer.createChild("span", "title"); |
| 97 | 95 |
| 98 this.subtitleElement = this.titlesElement.createChild("span", "subtitle"); | 96 this.subtitleElement = this.titlesElement.createChild("span", "subtitle"); |
| 99 | 97 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 171 |
| 174 if (this.className) | 172 if (this.className) |
| 175 this.listItemElement.classList.add(this.className); | 173 this.listItemElement.classList.add(this.className); |
| 176 | 174 |
| 177 if (this.small) | 175 if (this.small) |
| 178 this.listItemElement.classList.add("small"); | 176 this.listItemElement.classList.add("small"); |
| 179 | 177 |
| 180 if (this.hasChildren && this.disclosureButton) | 178 if (this.hasChildren && this.disclosureButton) |
| 181 this.listItemElement.appendChild(this.disclosureButton); | 179 this.listItemElement.appendChild(this.disclosureButton); |
| 182 | 180 |
| 183 this.listItemElement.appendChild(this.iconElement); | 181 this.listItemElement.appendChildren(this.iconElement, this.statusElement
, this.titlesElement); |
| 184 this.listItemElement.appendChild(this.statusElement); | |
| 185 this.listItemElement.appendChild(this.titlesElement); | |
| 186 }, | 182 }, |
| 187 | 183 |
| 188 onreveal: function() | 184 onreveal: function() |
| 189 { | 185 { |
| 190 if (this.listItemElement) | 186 if (this.listItemElement) |
| 191 this.listItemElement.scrollIntoViewIfNeeded(false); | 187 this.listItemElement.scrollIntoViewIfNeeded(false); |
| 192 }, | 188 }, |
| 193 | 189 |
| 194 __proto__: TreeElement.prototype | 190 __proto__: TreeElement.prototype |
| 195 } | 191 } |
| OLD | NEW |