OLD | NEW |
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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 | 152 |
153 /** | 153 /** |
154 * @constructor | 154 * @constructor |
155 * @extends {WebInspector.View} | 155 * @extends {WebInspector.View} |
156 */ | 156 */ |
157 WebInspector.SidebarPaneStack = function() | 157 WebInspector.SidebarPaneStack = function() |
158 { | 158 { |
159 WebInspector.View.call(this); | 159 WebInspector.View.call(this); |
160 this.setMinimumSize(25, 0); | 160 this.setMinimumSize(25, 0); |
161 this.element.className = "sidebar-pane-stack"; // Override | 161 this.element.className = "sidebar-pane-stack"; // Override |
| 162 /** @type {!Map.<!WebInspector.SidebarPane, !WebInspector.SidebarPaneTitle>}
*/ |
| 163 this._titleByPane = new Map(); |
162 } | 164 } |
163 | 165 |
164 WebInspector.SidebarPaneStack.prototype = { | 166 WebInspector.SidebarPaneStack.prototype = { |
165 /** | 167 /** |
166 * @param {!WebInspector.SidebarPane} pane | 168 * @param {!WebInspector.SidebarPane} pane |
167 */ | 169 */ |
168 addPane: function(pane) | 170 addPane: function(pane) |
169 { | 171 { |
170 new WebInspector.SidebarPaneTitle(this.element, pane); | 172 this._titleByPane.put(pane, new WebInspector.SidebarPaneTitle(this.eleme
nt, pane)); |
| 173 }, |
| 174 |
| 175 /** |
| 176 * @param {!WebInspector.SidebarPane} pane |
| 177 * @param {boolean} hide |
| 178 */ |
| 179 toggleHidden: function(pane, hide) |
| 180 { |
| 181 var title = this._titleByPane.get(pane); |
| 182 if (!title) |
| 183 return; |
| 184 |
| 185 title.element.classList.toggle("hidden", hide); |
| 186 pane.element.classList.toggle("hidden", hide); |
171 }, | 187 }, |
172 | 188 |
173 __proto__: WebInspector.View.prototype | 189 __proto__: WebInspector.View.prototype |
174 } | 190 } |
175 | 191 |
176 /** | 192 /** |
177 * @constructor | 193 * @constructor |
178 * @extends {WebInspector.TabbedPane} | 194 * @extends {WebInspector.TabbedPane} |
179 */ | 195 */ |
180 WebInspector.SidebarTabbedPane = function() | 196 WebInspector.SidebarTabbedPane = function() |
(...skipping 11 matching lines...) Expand all Loading... |
192 { | 208 { |
193 var title = pane.title(); | 209 var title = pane.title(); |
194 this.appendTab(title, title, pane); | 210 this.appendTab(title, title, pane); |
195 pane.element.appendChild(pane.titleElement); | 211 pane.element.appendChild(pane.titleElement); |
196 pane.setExpandCallback(this.selectTab.bind(this, title)); | 212 pane.setExpandCallback(this.selectTab.bind(this, title)); |
197 | 213 |
198 }, | 214 }, |
199 | 215 |
200 __proto__: WebInspector.TabbedPane.prototype | 216 __proto__: WebInspector.TabbedPane.prototype |
201 } | 217 } |
OLD | NEW |