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 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 return UI.viewManager.showView('elements').then(() => { | 778 return UI.viewManager.showView('elements').then(() => { |
779 this.selectDOMNode(node, true); | 779 this.selectDOMNode(node, true); |
780 delete this._omitDefaultSelection; | 780 delete this._omitDefaultSelection; |
781 | 781 |
782 if (!this._notFirstInspectElement) | 782 if (!this._notFirstInspectElement) |
783 InspectorFrontendHost.inspectElementCompleted(); | 783 InspectorFrontendHost.inspectElementCompleted(); |
784 this._notFirstInspectElement = true; | 784 this._notFirstInspectElement = true; |
785 }); | 785 }); |
786 } | 786 } |
787 | 787 |
788 _sidebarContextMenuEventFired(event) { | |
789 var contextMenu = new UI.ContextMenu(event); | |
790 contextMenu.appendApplicableItems(/** @type {!Object} */ (event.deepElementF
romPoint())); | |
791 contextMenu.show(); | |
792 } | |
793 | |
794 _showUAShadowDOMChanged() { | 788 _showUAShadowDOMChanged() { |
795 for (var i = 0; i < this._treeOutlines.length; ++i) | 789 for (var i = 0; i < this._treeOutlines.length; ++i) |
796 this._treeOutlines[i].update(); | 790 this._treeOutlines[i].update(); |
797 } | 791 } |
798 | 792 |
799 _updateSidebarPosition() { | 793 _updateSidebarPosition() { |
800 var horizontally; | 794 var horizontally; |
801 var position = Common.moduleSetting('sidebarPosition').get(); | 795 var position = Common.moduleSetting('sidebarPosition').get(); |
802 if (position === 'right') | 796 if (position === 'right') |
803 horizontally = false; | 797 horizontally = false; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
850 function tabSelected(event) { | 844 function tabSelected(event) { |
851 var tabId = /** @type {string} */ (event.data.tabId); | 845 var tabId = /** @type {string} */ (event.data.tabId); |
852 if (tabId === Common.UIString('Computed')) | 846 if (tabId === Common.UIString('Computed')) |
853 showMetrics.call(this, true); | 847 showMetrics.call(this, true); |
854 else if (tabId === Common.UIString('Styles')) | 848 else if (tabId === Common.UIString('Styles')) |
855 showMetrics.call(this, false); | 849 showMetrics.call(this, false); |
856 } | 850 } |
857 | 851 |
858 this.sidebarPaneView = UI.viewManager.createTabbedLocation(() => UI.viewMana
ger.showView('elements')); | 852 this.sidebarPaneView = UI.viewManager.createTabbedLocation(() => UI.viewMana
ger.showView('elements')); |
859 var tabbedPane = this.sidebarPaneView.tabbedPane(); | 853 var tabbedPane = this.sidebarPaneView.tabbedPane(); |
860 tabbedPane.element.addEventListener('contextmenu', this._sidebarContextMenuE
ventFired.bind(this), false); | |
861 if (this._popoverHelper) | 854 if (this._popoverHelper) |
862 this._popoverHelper.hidePopover(); | 855 this._popoverHelper.hidePopover(); |
863 this._popoverHelper = new UI.PopoverHelper(tabbedPane.element); | 856 this._popoverHelper = new UI.PopoverHelper(tabbedPane.element); |
864 this._popoverHelper.initializeCallbacks(this._getPopoverAnchor.bind(this), t
his._showPopover.bind(this)); | 857 this._popoverHelper.initializeCallbacks(this._getPopoverAnchor.bind(this), t
his._showPopover.bind(this)); |
865 this._popoverHelper.setTimeout(0); | 858 this._popoverHelper.setTimeout(0); |
866 | 859 |
867 if (horizontally) { | 860 if (horizontally) { |
868 // Styles and computed are merged into a single tab. | 861 // Styles and computed are merged into a single tab. |
869 this._splitWidget.installResizer(tabbedPane.headerElement()); | 862 this._splitWidget.installResizer(tabbedPane.headerElement()); |
870 | 863 |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1064 * @param {!SDK.DOMNode} node | 1057 * @param {!SDK.DOMNode} node |
1065 * @return {?{title: string, color: string}} | 1058 * @return {?{title: string, color: string}} |
1066 */ | 1059 */ |
1067 decorate(node) { | 1060 decorate(node) { |
1068 return { | 1061 return { |
1069 color: 'orange', | 1062 color: 'orange', |
1070 title: Common.UIString('Element state: %s', ':' + SDK.CSSModel.fromNode(no
de).pseudoState(node).join(', :')) | 1063 title: Common.UIString('Element state: %s', ':' + SDK.CSSModel.fromNode(no
de).pseudoState(node).join(', :')) |
1071 }; | 1064 }; |
1072 } | 1065 } |
1073 }; | 1066 }; |
OLD | NEW |