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 13 matching lines...) Expand all Loading... | |
24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
26 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 /** | 30 /** |
31 * @implements {UI.Searchable} | 31 * @implements {UI.Searchable} |
32 * @implements {SDK.SDKModelObserver<!SDK.DOMModel>} | 32 * @implements {SDK.SDKModelObserver<!SDK.DOMModel>} |
33 * @implements {UI.ViewLocationResolver} | 33 * @implements {UI.ViewLocationResolver} |
34 * @unrestricted | 34 * @unrestricted |
einbinder
2017/06/03 01:52:44
Remove unrestricted.
luoe
2017/06/05 19:03:21
Sorry, my CL title was misleading. I'm not adding
| |
35 */ | 35 */ |
36 Elements.ElementsPanel = class extends UI.Panel { | 36 Elements.ElementsPanel = class extends UI.Panel { |
37 constructor() { | 37 constructor() { |
38 super('elements'); | 38 super('elements'); |
39 this.registerRequiredCSS('elements/elementsPanel.css'); | 39 this.registerRequiredCSS('elements/elementsPanel.css'); |
40 | 40 |
41 this._splitWidget = new UI.SplitWidget(true, true, 'elementsPanelSplitViewSt ate', 325, 325); | 41 this._splitWidget = new UI.SplitWidget(true, true, 'elementsPanelSplitViewSt ate', 325, 325); |
42 this._splitWidget.addEventListener( | 42 this._splitWidget.addEventListener( |
43 UI.SplitWidget.Events.SidebarSizeChanged, this._updateTreeOutlineVisible Width.bind(this)); | 43 UI.SplitWidget.Events.SidebarSizeChanged, this._updateTreeOutlineVisible Width.bind(this)); |
44 this._splitWidget.show(this.element); | 44 this._splitWidget.show(this.element); |
(...skipping 16 matching lines...) Expand all 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|undefined} */ | |
78 this._pendingWidgetToggle; | |
einbinder
2017/06/03 01:52:44
= null
luoe
2017/06/05 19:03:20
Done.
| |
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 855 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 |