Chromium Code Reviews| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 44 this._splitView.addEventListener(WebInspector.SplitView.Events.SidebarSizeCh anged, this._updateTreeOutlineVisibleWidth.bind(this)); | 44 this._splitView.addEventListener(WebInspector.SplitView.Events.SidebarSizeCh anged, this._updateTreeOutlineVisibleWidth.bind(this)); |
| 45 this._splitView.show(this.element); | 45 this._splitView.show(this.element); |
| 46 | 46 |
| 47 this._searchableView = new WebInspector.SearchableView(this); | 47 this._searchableView = new WebInspector.SearchableView(this); |
| 48 this._searchableView.setMinimumSize(25, 19); | 48 this._searchableView.setMinimumSize(25, 19); |
| 49 this._searchableView.show(this._splitView.mainElement()); | 49 this._searchableView.show(this._splitView.mainElement()); |
| 50 var stackElement = this._searchableView.element; | 50 var stackElement = this._searchableView.element; |
| 51 | 51 |
| 52 this.contentElement = stackElement.createChild("div"); | 52 this.contentElement = stackElement.createChild("div"); |
| 53 this.contentElement.id = "elements-content"; | 53 this.contentElement.id = "elements-content"; |
| 54 this.contentElement.classList.add("outline-disclosure"); | 54 this.contentElement.classList.add("outline-disclosure", "source-code"); |
|
apavlov
2014/10/13 15:10:09
We could add these in the createChild() call just
| |
| 55 this.contentElement.classList.add("source-code"); | |
| 56 if (!WebInspector.settings.domWordWrap.get()) | 55 if (!WebInspector.settings.domWordWrap.get()) |
| 57 this.contentElement.classList.add("nowrap"); | 56 this.contentElement.classList.add("nowrap"); |
| 58 WebInspector.settings.domWordWrap.addChangeListener(this._domWordWrapSetting Changed.bind(this)); | 57 WebInspector.settings.domWordWrap.addChangeListener(this._domWordWrapSetting Changed.bind(this)); |
| 59 | 58 |
| 60 this._splitView.sidebarElement().addEventListener("contextmenu", this._sideb arContextMenuEventFired.bind(this), false); | 59 this._splitView.sidebarElement().addEventListener("contextmenu", this._sideb arContextMenuEventFired.bind(this), false); |
| 61 | 60 |
| 62 var crumbsContainer = stackElement.createChild("div"); | 61 var crumbsContainer = stackElement.createChild("div"); |
| 63 crumbsContainer.id = "elements-crumbs"; | 62 crumbsContainer.id = "elements-crumbs"; |
| 64 this.crumbsElement = crumbsContainer.createChild("div", "crumbs"); | 63 this.crumbsElement = crumbsContainer.createChild("div", "crumbs"); |
| 65 this.crumbsElement.addEventListener("mousemove", this._mouseMovedInCrumbs.bi nd(this), false); | 64 this.crumbsElement.addEventListener("mousemove", this._mouseMovedInCrumbs.bi nd(this), false); |
| (...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 685 | 684 |
| 686 _metricsPaneEdited: function() | 685 _metricsPaneEdited: function() |
| 687 { | 686 { |
| 688 // Once metrics are edited, the Styles pane should be updated. | 687 // Once metrics are edited, the Styles pane should be updated. |
| 689 this.sidebarPanes.styles.needsUpdate = true; | 688 this.sidebarPanes.styles.needsUpdate = true; |
| 690 this.updateStyles(true); | 689 this.updateStyles(true); |
| 691 }, | 690 }, |
| 692 | 691 |
| 693 _mouseMovedInCrumbs: function(event) | 692 _mouseMovedInCrumbs: function(event) |
| 694 { | 693 { |
| 695 var nodeUnderMouse = document.elementFromPoint(event.pageX, event.pageY) ; | 694 var nodeUnderMouse = event.elementFromPoint(); |
| 696 var crumbElement = nodeUnderMouse.enclosingNodeOrSelfWithClass("crumb"); | 695 var crumbElement = nodeUnderMouse.enclosingNodeOrSelfWithClass("crumb"); |
| 697 var node = /** @type {?WebInspector.DOMNode} */ (crumbElement ? crumbEle ment.representedObject : null); | 696 var node = /** @type {?WebInspector.DOMNode} */ (crumbElement ? crumbEle ment.representedObject : null); |
| 698 if (node) | 697 if (node) |
| 699 node.highlight(); | 698 node.highlight(); |
| 700 }, | 699 }, |
| 701 | 700 |
| 702 _mouseMovedOutOfCrumbs: function(event) | 701 _mouseMovedOutOfCrumbs: function(event) |
| 703 { | 702 { |
| 704 var nodeUnderMouse = document.elementFromPoint(event.pageX, event.pageY) ; | 703 var nodeUnderMouse = event.elementFromPoint(); |
| 705 if (nodeUnderMouse && nodeUnderMouse.isDescendant(this.crumbsElement)) | 704 if (nodeUnderMouse && nodeUnderMouse.isDescendant(this.crumbsElement)) |
| 706 return; | 705 return; |
| 707 | 706 |
| 708 for (var i = 0; i < this._treeOutlines.length; ++i) | 707 for (var i = 0; i < this._treeOutlines.length; ++i) |
| 709 this._treeOutlines[i].domModel().hideDOMNodeHighlight(); | 708 this._treeOutlines[i].domModel().hideDOMNodeHighlight(); |
| 710 }, | 709 }, |
| 711 | 710 |
| 712 /** | 711 /** |
| 713 * @param {boolean=} forceUpdate | 712 * @param {boolean=} forceUpdate |
| 714 */ | 713 */ |
| (...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1533 | 1532 |
| 1534 WebInspector.ElementsPanelFactory.prototype = { | 1533 WebInspector.ElementsPanelFactory.prototype = { |
| 1535 /** | 1534 /** |
| 1536 * @return {!WebInspector.Panel} | 1535 * @return {!WebInspector.Panel} |
| 1537 */ | 1536 */ |
| 1538 createPanel: function() | 1537 createPanel: function() |
| 1539 { | 1538 { |
| 1540 return WebInspector.ElementsPanel.instance(); | 1539 return WebInspector.ElementsPanel.instance(); |
| 1541 } | 1540 } |
| 1542 } | 1541 } |
| OLD | NEW |