| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Google Inc. All rights reserved. | 3 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 */ | 28 */ |
| 29 | 29 |
| 30 /** | 30 /** |
| 31 * @constructor | 31 * @constructor |
| 32 * @param {string|!Element} title | 32 * @param {string|!Element} title |
| 33 * @param {string=} subtitle | 33 * @param {string=} subtitle |
| 34 */ | 34 */ |
| 35 WebInspector.Section = function(title, subtitle) | 35 WebInspector.Section = function(title, subtitle) |
| 36 { | 36 { |
| 37 this.element = document.createElement("div"); | 37 this.element = createElement("div"); |
| 38 this.element.className = "section"; | 38 this.element.className = "section"; |
| 39 this.element._section = this; | 39 this.element._section = this; |
| 40 | 40 |
| 41 this.headerElement = document.createElement("div"); | 41 this.headerElement = createElement("div"); |
| 42 this.headerElement.className = "header"; | 42 this.headerElement.className = "header"; |
| 43 | 43 |
| 44 this.titleElement = document.createElement("div"); | 44 this.titleElement = createElement("div"); |
| 45 this.titleElement.className = "title"; | 45 this.titleElement.className = "title"; |
| 46 | 46 |
| 47 this.subtitleElement = document.createElement("div"); | 47 this.subtitleElement = createElement("div"); |
| 48 this.subtitleElement.className = "subtitle"; | 48 this.subtitleElement.className = "subtitle"; |
| 49 | 49 |
| 50 this.headerElement.appendChild(this.subtitleElement); | 50 this.headerElement.appendChild(this.subtitleElement); |
| 51 this.headerElement.appendChild(this.titleElement); | 51 this.headerElement.appendChild(this.titleElement); |
| 52 | 52 |
| 53 this.headerElement.addEventListener("click", this.handleClick.bind(this), fa
lse); | 53 this.headerElement.addEventListener("click", this.handleClick.bind(this), fa
lse); |
| 54 this.element.appendChild(this.headerElement); | 54 this.element.appendChild(this.headerElement); |
| 55 | 55 |
| 56 this.title = title; | 56 this.title = title; |
| 57 this.subtitle = subtitle; | 57 this.subtitle = subtitle; |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 { | 211 { |
| 212 this.expanded = !this.expanded; | 212 this.expanded = !this.expanded; |
| 213 }, | 213 }, |
| 214 | 214 |
| 215 handleClick: function(event) | 215 handleClick: function(event) |
| 216 { | 216 { |
| 217 this.toggleExpanded(); | 217 this.toggleExpanded(); |
| 218 event.consume(); | 218 event.consume(); |
| 219 } | 219 } |
| 220 } | 220 } |
| OLD | NEW |