OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> | 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> |
4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 | 262 |
263 /** | 263 /** |
264 * @override | 264 * @override |
265 * @return {!WebInspector.SearchableView} | 265 * @return {!WebInspector.SearchableView} |
266 */ | 266 */ |
267 searchableView: function() | 267 searchableView: function() |
268 { | 268 { |
269 return this._searchableView; | 269 return this._searchableView; |
270 }, | 270 }, |
271 | 271 |
| 272 /** |
| 273 * @override |
| 274 */ |
272 wasShown: function() | 275 wasShown: function() |
273 { | 276 { |
274 WebInspector.context.setFlavor(WebInspector.ElementsPanel, this); | 277 WebInspector.context.setFlavor(WebInspector.ElementsPanel, this); |
275 | 278 |
276 for (var i = 0; i < this._treeOutlines.length; ++i) { | 279 for (var i = 0; i < this._treeOutlines.length; ++i) { |
277 var treeOutline = this._treeOutlines[i]; | 280 var treeOutline = this._treeOutlines[i]; |
278 // Attach heavy component lazily | 281 // Attach heavy component lazily |
279 if (treeOutline.element.parentElement !== this._contentElement) | 282 if (treeOutline.element.parentElement !== this._contentElement) |
280 this._contentElement.appendChild(treeOutline.element); | 283 this._contentElement.appendChild(treeOutline.element); |
281 } | 284 } |
282 WebInspector.Panel.prototype.wasShown.call(this); | 285 WebInspector.Panel.prototype.wasShown.call(this); |
283 this._breadcrumbs.update(); | 286 this._breadcrumbs.update(); |
284 | 287 |
285 for (var i = 0; i < this._treeOutlines.length; ++i) { | 288 for (var i = 0; i < this._treeOutlines.length; ++i) { |
286 var treeOutline = this._treeOutlines[i]; | 289 var treeOutline = this._treeOutlines[i]; |
287 treeOutline.setVisible(true); | 290 treeOutline.setVisible(true); |
288 | 291 |
289 if (!treeOutline.rootDOMNode) | 292 if (!treeOutline.rootDOMNode) |
290 if (treeOutline.domModel().existingDocument()) | 293 if (treeOutline.domModel().existingDocument()) |
291 this._documentUpdated(treeOutline.domModel(), treeOutline.do
mModel().existingDocument()); | 294 this._documentUpdated(treeOutline.domModel(), treeOutline.do
mModel().existingDocument()); |
292 else | 295 else |
293 treeOutline.domModel().requestDocument(); | 296 treeOutline.domModel().requestDocument(); |
294 } | 297 } |
295 this.focus(); | 298 this.focus(); |
296 }, | 299 }, |
297 | 300 |
| 301 /** |
| 302 * @override |
| 303 */ |
298 willHide: function() | 304 willHide: function() |
299 { | 305 { |
300 WebInspector.context.setFlavor(WebInspector.ElementsPanel, null); | 306 WebInspector.context.setFlavor(WebInspector.ElementsPanel, null); |
301 | 307 |
302 WebInspector.DOMModel.hideDOMNodeHighlight(); | 308 WebInspector.DOMModel.hideDOMNodeHighlight(); |
303 for (var i = 0; i < this._treeOutlines.length; ++i) { | 309 for (var i = 0; i < this._treeOutlines.length; ++i) { |
304 var treeOutline = this._treeOutlines[i]; | 310 var treeOutline = this._treeOutlines[i]; |
305 treeOutline.setVisible(false); | 311 treeOutline.setVisible(false); |
306 // Detach heavy component on hide | 312 // Detach heavy component on hide |
307 this._contentElement.removeChild(treeOutline.element); | 313 this._contentElement.removeChild(treeOutline.element); |
308 } | 314 } |
309 if (this._popoverHelper) | 315 if (this._popoverHelper) |
310 this._popoverHelper.hidePopover(); | 316 this._popoverHelper.hidePopover(); |
311 WebInspector.Panel.prototype.willHide.call(this); | 317 WebInspector.Panel.prototype.willHide.call(this); |
312 }, | 318 }, |
313 | 319 |
| 320 /** |
| 321 * @override |
| 322 */ |
314 onResize: function() | 323 onResize: function() |
315 { | 324 { |
316 if (WebInspector.moduleSetting("sidebarPosition").get() === "auto") | 325 if (WebInspector.moduleSetting("sidebarPosition").get() === "auto") |
317 this.element.window().requestAnimationFrame(this._updateSidebarPosit
ion.bind(this)); // Do not force layout. | 326 this.element.window().requestAnimationFrame(this._updateSidebarPosit
ion.bind(this)); // Do not force layout. |
318 this._updateTreeOutlineVisibleWidth(); | 327 this._updateTreeOutlineVisibleWidth(); |
319 }, | 328 }, |
320 | 329 |
321 /** | 330 /** |
322 * @param {!WebInspector.Event} event | 331 * @param {!WebInspector.Event} event |
323 */ | 332 */ |
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1121 /** | 1130 /** |
1122 * @override | 1131 * @override |
1123 * @param {!WebInspector.DOMNode} node | 1132 * @param {!WebInspector.DOMNode} node |
1124 * @return {?{title: string, color: string}} | 1133 * @return {?{title: string, color: string}} |
1125 */ | 1134 */ |
1126 decorate: function(node) | 1135 decorate: function(node) |
1127 { | 1136 { |
1128 return { color: "orange", title: WebInspector.UIString("Element state: %
s", ":" + WebInspector.CSSModel.fromNode(node).pseudoState(node).join(", :")) }; | 1137 return { color: "orange", title: WebInspector.UIString("Element state: %
s", ":" + WebInspector.CSSModel.fromNode(node).pseudoState(node).join(", :")) }; |
1129 } | 1138 } |
1130 }; | 1139 }; |
OLD | NEW |