| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // FIXME: crbug.com/425984 | 61 // FIXME: crbug.com/425984 |
| 62 if (Common.moduleSetting('domWordWrap').get()) | 62 if (Common.moduleSetting('domWordWrap').get()) |
| 63 this._contentElement.classList.add('elements-wrap'); | 63 this._contentElement.classList.add('elements-wrap'); |
| 64 Common.moduleSetting('domWordWrap').addChangeListener(this._domWordWrapSetti
ngChanged.bind(this)); | 64 Common.moduleSetting('domWordWrap').addChangeListener(this._domWordWrapSetti
ngChanged.bind(this)); |
| 65 | 65 |
| 66 crumbsContainer.id = 'elements-crumbs'; | 66 crumbsContainer.id = 'elements-crumbs'; |
| 67 this._breadcrumbs = new Elements.ElementsBreadcrumbs(); | 67 this._breadcrumbs = new Elements.ElementsBreadcrumbs(); |
| 68 this._breadcrumbs.show(crumbsContainer); | 68 this._breadcrumbs.show(crumbsContainer); |
| 69 this._breadcrumbs.addEventListener(Elements.ElementsBreadcrumbs.Events.NodeS
elected, this._crumbNodeSelected, this); | 69 this._breadcrumbs.addEventListener(Elements.ElementsBreadcrumbs.Events.NodeS
elected, this._crumbNodeSelected, this); |
| 70 | 70 |
| 71 /** @type {?UI.Widget} */ |
| 71 this._currentToolbarPane = null; | 72 this._currentToolbarPane = null; |
| 73 /** @type {?UI.Widget} */ |
| 74 this._animatedToolbarPane = null; |
| 75 /** @type {?UI.Widget} */ |
| 76 this._pendingWidget = null; |
| 77 /** @type {?UI.ToolbarToggle} */ |
| 78 this._pendingWidgetToggle = null; |
| 72 | 79 |
| 73 this._stylesWidget = new Elements.StylesSidebarPane(); | 80 this._stylesWidget = new Elements.StylesSidebarPane(); |
| 74 this._computedStyleWidget = new Elements.ComputedStyleWidget(); | 81 this._computedStyleWidget = new Elements.ComputedStyleWidget(); |
| 75 this._metricsWidget = new Elements.MetricsSidebarPane(); | 82 this._metricsWidget = new Elements.MetricsSidebarPane(); |
| 76 | 83 |
| 77 this._stylesSidebarToolbar = this._createStylesSidebarToolbar(); | 84 this._stylesSidebarToolbar = this._createStylesSidebarToolbar(); |
| 78 | 85 |
| 79 Common.moduleSetting('sidebarPosition').addChangeListener(this._updateSideba
rPosition.bind(this)); | 86 Common.moduleSetting('sidebarPosition').addChangeListener(this._updateSideba
rPosition.bind(this)); |
| 80 this._updateSidebarPosition(); | 87 this._updateSidebarPosition(); |
| 81 | 88 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 * @override | 141 * @override |
| 135 * @param {string} locationName | 142 * @param {string} locationName |
| 136 * @return {?UI.ViewLocation} | 143 * @return {?UI.ViewLocation} |
| 137 */ | 144 */ |
| 138 resolveLocation(locationName) { | 145 resolveLocation(locationName) { |
| 139 return this.sidebarPaneView; | 146 return this.sidebarPaneView; |
| 140 } | 147 } |
| 141 | 148 |
| 142 /** | 149 /** |
| 143 * @param {?UI.Widget} widget | 150 * @param {?UI.Widget} widget |
| 144 * @param {!UI.ToolbarToggle=} toggle | 151 * @param {?UI.ToolbarToggle} toggle |
| 145 */ | 152 */ |
| 146 showToolbarPane(widget, toggle) { | 153 showToolbarPane(widget, toggle) { |
| 147 if (this._pendingWidgetToggle) | 154 if (this._pendingWidgetToggle) |
| 148 this._pendingWidgetToggle.setToggled(false); | 155 this._pendingWidgetToggle.setToggled(false); |
| 149 this._pendingWidgetToggle = toggle; | 156 this._pendingWidgetToggle = toggle; |
| 150 | 157 |
| 151 if (this._animatedToolbarPane !== undefined) | 158 if (this._animatedToolbarPane) |
| 152 this._pendingWidget = widget; | 159 this._pendingWidget = widget; |
| 153 else | 160 else |
| 154 this._startToolbarPaneAnimation(widget); | 161 this._startToolbarPaneAnimation(widget); |
| 155 | 162 |
| 156 if (widget && toggle) | 163 if (widget && toggle) |
| 157 toggle.setToggled(true); | 164 toggle.setToggled(true); |
| 158 } | 165 } |
| 159 | 166 |
| 160 /** | 167 /** |
| 161 * @param {?UI.Widget} widget | 168 * @param {?UI.Widget} widget |
| (...skipping 29 matching lines...) Expand all Loading... |
| 191 function onAnimationEnd() { | 198 function onAnimationEnd() { |
| 192 this._toolbarPaneElement.style.removeProperty('animation-name'); | 199 this._toolbarPaneElement.style.removeProperty('animation-name'); |
| 193 this._toolbarPaneElement.removeEventListener('animationend', listener, fal
se); | 200 this._toolbarPaneElement.removeEventListener('animationend', listener, fal
se); |
| 194 | 201 |
| 195 if (this._currentToolbarPane) | 202 if (this._currentToolbarPane) |
| 196 this._currentToolbarPane.detach(); | 203 this._currentToolbarPane.detach(); |
| 197 | 204 |
| 198 this._currentToolbarPane = this._animatedToolbarPane; | 205 this._currentToolbarPane = this._animatedToolbarPane; |
| 199 if (this._currentToolbarPane) | 206 if (this._currentToolbarPane) |
| 200 this._currentToolbarPane.focus(); | 207 this._currentToolbarPane.focus(); |
| 201 delete this._animatedToolbarPane; | 208 this._animatedToolbarPane = null; |
| 202 | 209 |
| 203 if (this._pendingWidget !== undefined) { | 210 if (this._pendingWidget) { |
| 204 this._startToolbarPaneAnimation(this._pendingWidget); | 211 this._startToolbarPaneAnimation(this._pendingWidget); |
| 205 delete this._pendingWidget; | 212 this._pendingWidget = null; |
| 206 } | 213 } |
| 207 } | 214 } |
| 208 } | 215 } |
| 209 | 216 |
| 210 /** | 217 /** |
| 211 * @override | 218 * @override |
| 212 * @param {!SDK.DOMModel} domModel | 219 * @param {!SDK.DOMModel} domModel |
| 213 */ | 220 */ |
| 214 modelAdded(domModel) { | 221 modelAdded(domModel) { |
| 215 var treeOutline = new Elements.ElementsTreeOutline(domModel, true, true); | 222 var treeOutline = new Elements.ElementsTreeOutline(domModel, true, true); |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 824 return; | 831 return; |
| 825 this._splitMode = splitMode; | 832 this._splitMode = splitMode; |
| 826 | 833 |
| 827 var extensionSidebarPanes = Extensions.extensionServer.sidebarPanes(); | 834 var extensionSidebarPanes = Extensions.extensionServer.sidebarPanes(); |
| 828 if (this.sidebarPaneView) { | 835 if (this.sidebarPaneView) { |
| 829 this.sidebarPaneView.tabbedPane().detach(); | 836 this.sidebarPaneView.tabbedPane().detach(); |
| 830 this._splitWidget.uninstallResizer(this.sidebarPaneView.tabbedPane().heade
rElement()); | 837 this._splitWidget.uninstallResizer(this.sidebarPaneView.tabbedPane().heade
rElement()); |
| 831 } | 838 } |
| 832 | 839 |
| 833 this._splitWidget.setVertical(this._splitMode === Elements.ElementsPanel._sp
litMode.Vertical); | 840 this._splitWidget.setVertical(this._splitMode === Elements.ElementsPanel._sp
litMode.Vertical); |
| 834 this.showToolbarPane(null); | 841 this.showToolbarPane(null /* widget */, null /* toggle */); |
| 835 | 842 |
| 836 var matchedStylesContainer = new UI.VBox(); | 843 var matchedStylesContainer = new UI.VBox(); |
| 837 matchedStylesContainer.element.appendChild(this._stylesSidebarToolbar); | 844 matchedStylesContainer.element.appendChild(this._stylesSidebarToolbar); |
| 838 var matchedStylePanesWrapper = new UI.VBox(); | 845 var matchedStylePanesWrapper = new UI.VBox(); |
| 839 matchedStylePanesWrapper.element.classList.add('style-panes-wrapper'); | 846 matchedStylePanesWrapper.element.classList.add('style-panes-wrapper'); |
| 840 matchedStylePanesWrapper.show(matchedStylesContainer.element); | 847 matchedStylePanesWrapper.show(matchedStylesContainer.element); |
| 841 this._stylesWidget.show(matchedStylePanesWrapper.element); | 848 this._stylesWidget.show(matchedStylePanesWrapper.element); |
| 842 | 849 |
| 843 var computedStylePanesWrapper = new UI.VBox(); | 850 var computedStylePanesWrapper = new UI.VBox(); |
| 844 computedStylePanesWrapper.element.classList.add('style-panes-wrapper'); | 851 computedStylePanesWrapper.element.classList.add('style-panes-wrapper'); |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1071 * @param {!SDK.DOMNode} node | 1078 * @param {!SDK.DOMNode} node |
| 1072 * @return {?{title: string, color: string}} | 1079 * @return {?{title: string, color: string}} |
| 1073 */ | 1080 */ |
| 1074 decorate(node) { | 1081 decorate(node) { |
| 1075 return { | 1082 return { |
| 1076 color: 'orange', | 1083 color: 'orange', |
| 1077 title: Common.UIString('Element state: %s', ':' + node.domModel().cssModel
().pseudoState(node).join(', :')) | 1084 title: Common.UIString('Element state: %s', ':' + node.domModel().cssModel
().pseudoState(node).join(', :')) |
| 1078 }; | 1085 }; |
| 1079 } | 1086 } |
| 1080 }; | 1087 }; |
| OLD | NEW |