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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 if (this._smallChildren === x) | 51 if (this._smallChildren === x) |
52 return; | 52 return; |
53 | 53 |
54 this._smallChildren = x; | 54 this._smallChildren = x; |
55 | 55 |
56 this._childrenListNode.classList.toggle("small", this._smallChildren); | 56 this._childrenListNode.classList.toggle("small", this._smallChildren); |
57 }, | 57 }, |
58 | 58 |
59 onattach: function() | 59 onattach: function() |
60 { | 60 { |
61 this._listItemNode.classList.add("sidebar-tree-section"); | 61 this.listItemElement.classList.add("sidebar-tree-section"); |
62 }, | 62 }, |
63 | 63 |
64 onreveal: function() | 64 onreveal: function() |
65 { | 65 { |
66 if (this.listItemElement) | 66 if (this.listItemElement) |
67 this.listItemElement.scrollIntoViewIfNeeded(false); | 67 this.listItemElement.scrollIntoViewIfNeeded(false); |
68 }, | 68 }, |
69 | 69 |
70 __proto__: TreeElement.prototype | 70 __proto__: TreeElement.prototype |
71 } | 71 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 104 |
105 WebInspector.SidebarTreeElement.prototype = { | 105 WebInspector.SidebarTreeElement.prototype = { |
106 get small() | 106 get small() |
107 { | 107 { |
108 return this._small; | 108 return this._small; |
109 }, | 109 }, |
110 | 110 |
111 set small(x) | 111 set small(x) |
112 { | 112 { |
113 this._small = x; | 113 this._small = x; |
114 if (this._listItemNode) | 114 if (this.listItemElement) |
115 this._listItemNode.classList.toggle("small", this._small); | 115 this.listItemElement.classList.toggle("small", this._small); |
116 }, | 116 }, |
117 | 117 |
118 get mainTitle() | 118 get mainTitle() |
119 { | 119 { |
120 return this._mainTitle; | 120 return this._mainTitle; |
121 }, | 121 }, |
122 | 122 |
123 set mainTitle(x) | 123 set mainTitle(x) |
124 { | 124 { |
125 this._mainTitle = x; | 125 this._mainTitle = x; |
126 this.refreshTitles(); | 126 this.refreshTitles(); |
127 }, | 127 }, |
128 | 128 |
129 get subtitle() | 129 get subtitle() |
130 { | 130 { |
131 return this._subtitle; | 131 return this._subtitle; |
132 }, | 132 }, |
133 | 133 |
134 set subtitle(x) | 134 set subtitle(x) |
135 { | 135 { |
136 this._subtitle = x; | 136 this._subtitle = x; |
137 this.refreshTitles(); | 137 this.refreshTitles(); |
138 }, | 138 }, |
139 | 139 |
140 set wait(x) | 140 set wait(x) |
141 { | 141 { |
142 this._listItemNode.classList.toggle("wait", x); | 142 this.listItemElement.classList.toggle("wait", x); |
143 }, | 143 }, |
144 | 144 |
145 refreshTitles: function() | 145 refreshTitles: function() |
146 { | 146 { |
147 var mainTitle = this.mainTitle; | 147 var mainTitle = this.mainTitle; |
148 if (this.titleElement.textContent !== mainTitle) | 148 if (this.titleElement.textContent !== mainTitle) |
149 this.titleElement.textContent = mainTitle; | 149 this.titleElement.textContent = mainTitle; |
150 | 150 |
151 var subtitle = this.subtitle; | 151 var subtitle = this.subtitle; |
152 if (subtitle) { | 152 if (subtitle) { |
153 if (this.subtitleElement.textContent !== subtitle) | 153 if (this.subtitleElement.textContent !== subtitle) |
154 this.subtitleElement.textContent = subtitle; | 154 this.subtitleElement.textContent = subtitle; |
155 this.titlesElement.classList.remove("no-subtitle"); | 155 this.titlesElement.classList.remove("no-subtitle"); |
156 } else { | 156 } else { |
157 this.subtitleElement.textContent = ""; | 157 this.subtitleElement.textContent = ""; |
158 this.titlesElement.classList.add("no-subtitle"); | 158 this.titlesElement.classList.add("no-subtitle"); |
159 } | 159 } |
160 }, | 160 }, |
161 | 161 |
162 /** | 162 /** |
163 * @return {boolean} | 163 * @return {boolean} |
164 */ | 164 */ |
165 isEventWithinDisclosureTriangle: function(event) | 165 isEventWithinDisclosureTriangle: function(event) |
166 { | 166 { |
167 return event.target === this.disclosureButton; | 167 return event.target === this.disclosureButton; |
168 }, | 168 }, |
169 | 169 |
170 onattach: function() | 170 onattach: function() |
171 { | 171 { |
172 this._listItemNode.classList.add("sidebar-tree-item"); | 172 this.listItemElement.classList.add("sidebar-tree-item"); |
173 | 173 |
174 if (this.className) | 174 if (this.className) |
175 this._listItemNode.classList.add(this.className); | 175 this.listItemElement.classList.add(this.className); |
176 | 176 |
177 if (this.small) | 177 if (this.small) |
178 this._listItemNode.classList.add("small"); | 178 this.listItemElement.classList.add("small"); |
179 | 179 |
180 if (this.hasChildren && this.disclosureButton) | 180 if (this.hasChildren && this.disclosureButton) |
181 this._listItemNode.appendChild(this.disclosureButton); | 181 this.listItemElement.appendChild(this.disclosureButton); |
182 | 182 |
183 this._listItemNode.appendChild(this.iconElement); | 183 this.listItemElement.appendChild(this.iconElement); |
184 this._listItemNode.appendChild(this.statusElement); | 184 this.listItemElement.appendChild(this.statusElement); |
185 this._listItemNode.appendChild(this.titlesElement); | 185 this.listItemElement.appendChild(this.titlesElement); |
186 }, | 186 }, |
187 | 187 |
188 onreveal: function() | 188 onreveal: function() |
189 { | 189 { |
190 if (this._listItemNode) | 190 if (this.listItemElement) |
191 this._listItemNode.scrollIntoViewIfNeeded(false); | 191 this.listItemElement.scrollIntoViewIfNeeded(false); |
192 }, | 192 }, |
193 | 193 |
194 __proto__: TreeElement.prototype | 194 __proto__: TreeElement.prototype |
195 } | 195 } |
OLD | NEW |