Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js

Issue 1983323002: [DevTools] Properly update resizer in SourcesPanel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/ui/InspectorView.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 paused: function() 166 paused: function()
167 { 167 {
168 return this._paused; 168 return this._paused;
169 }, 169 },
170 170
171 wasShown: function() 171 wasShown: function()
172 { 172 {
173 WebInspector.context.setFlavor(WebInspector.SourcesPanel, this); 173 WebInspector.context.setFlavor(WebInspector.SourcesPanel, this);
174 WebInspector.Panel.prototype.wasShown.call(this); 174 WebInspector.Panel.prototype.wasShown.call(this);
175 var wrapper = WebInspector.SourcesPanel.WrapperView._instance; 175 var wrapper = WebInspector.SourcesPanel.WrapperView._instance;
176 if (wrapper && wrapper.isShowing()) 176 if (wrapper && wrapper.isShowing()) {
177 WebInspector.inspectorView.setDrawerMinimized(true); 177 WebInspector.inspectorView.setDrawerMinimized(true);
178 WebInspector.SourcesPanel.updateResizer(this);
179 }
178 this.editorView.setMainWidget(this._sourcesView); 180 this.editorView.setMainWidget(this._sourcesView);
179 }, 181 },
180 182
181 willHide: function() 183 willHide: function()
182 { 184 {
183 WebInspector.Panel.prototype.willHide.call(this); 185 WebInspector.Panel.prototype.willHide.call(this);
184 WebInspector.context.setFlavor(WebInspector.SourcesPanel, null); 186 WebInspector.context.setFlavor(WebInspector.SourcesPanel, null);
185 if (WebInspector.SourcesPanel.WrapperView._instance && WebInspector.Sour cesPanel.WrapperView._instance.isShowing()) { 187 if (WebInspector.SourcesPanel.WrapperView.isShowing()) {
186 WebInspector.SourcesPanel.WrapperView._instance._showViewInWrapper() ; 188 WebInspector.SourcesPanel.WrapperView._instance._showViewInWrapper() ;
187 WebInspector.inspectorView.setDrawerMinimized(false); 189 WebInspector.inspectorView.setDrawerMinimized(false);
190 WebInspector.SourcesPanel.updateResizer(this);
188 } 191 }
189 }, 192 },
190 193
191 /** 194 /**
192 * @return {boolean} 195 * @return {boolean}
193 */ 196 */
194 _ensureSourcesViewVisible: function() 197 _ensureSourcesViewVisible: function()
195 { 198 {
196 if (WebInspector.SourcesPanel.WrapperView._instance && WebInspector.Sour cesPanel.WrapperView._instance.isShowing()) 199 if (WebInspector.SourcesPanel.WrapperView.isShowing())
197 return true; 200 return true;
198 return this === WebInspector.inspectorView.setCurrentPanel(this); 201 return this === WebInspector.inspectorView.setCurrentPanel(this);
199 }, 202 },
200 203
201 onResize: function() 204 onResize: function()
202 { 205 {
203 if (WebInspector.moduleSetting("sidebarPosition").get() === "auto") 206 if (WebInspector.moduleSetting("sidebarPosition").get() === "auto")
204 this.element.window().requestAnimationFrame(this._updateSidebarPosit ion.bind(this)); // Do not force layout. 207 this.element.window().requestAnimationFrame(this._updateSidebarPosit ion.bind(this)); // Do not force layout.
205 }, 208 },
206 209
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
1088 1091
1089 if (this.sidebarPaneView && this.sidebarPaneView.shouldHideOnDetach()) 1092 if (this.sidebarPaneView && this.sidebarPaneView.shouldHideOnDetach())
1090 return; // We can't reparent extension iframes. 1093 return; // We can't reparent extension iframes.
1091 1094
1092 if (this.sidebarPaneView) 1095 if (this.sidebarPaneView)
1093 this.sidebarPaneView.detach(); 1096 this.sidebarPaneView.detach();
1094 1097
1095 this._splitWidget.setVertical(!vertically); 1098 this._splitWidget.setVertical(!vertically);
1096 this._splitWidget.element.classList.toggle("sources-split-view-vertical" , vertically); 1099 this._splitWidget.element.classList.toggle("sources-split-view-vertical" , vertically);
1097 1100
1098 if (!vertically) 1101 WebInspector.SourcesPanel.updateResizer(this);
1099 this._splitWidget.uninstallResizer(this._sourcesView.toolbarContaine rElement());
1100 else
1101 this._splitWidget.installResizer(this._sourcesView.toolbarContainerE lement());
1102 1102
1103 // Create vertical box with stack. 1103 // Create vertical box with stack.
1104 var vbox = new WebInspector.VBox(); 1104 var vbox = new WebInspector.VBox();
1105 vbox.element.appendChild(this._debugToolbarDrawer); 1105 vbox.element.appendChild(this._debugToolbarDrawer);
1106 vbox.setMinimumAndPreferredSizes(25, 25, WebInspector.SourcesPanel.minTo olbarWidth, 100); 1106 vbox.setMinimumAndPreferredSizes(25, 25, WebInspector.SourcesPanel.minTo olbarWidth, 100);
1107 var sidebarPaneStack = new WebInspector.SidebarPaneStack(); 1107 var sidebarPaneStack = new WebInspector.SidebarPaneStack();
1108 sidebarPaneStack.element.classList.add("flex-auto"); 1108 sidebarPaneStack.element.classList.add("flex-auto");
1109 sidebarPaneStack.show(vbox.element); 1109 sidebarPaneStack.show(vbox.element);
1110 vbox.element.appendChild(this._debugToolbar.element); 1110 vbox.element.appendChild(this._debugToolbar.element);
1111 1111
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
1396 * @return {!WebInspector.SourcesPanel} 1396 * @return {!WebInspector.SourcesPanel}
1397 */ 1397 */
1398 WebInspector.SourcesPanel.instance = function() 1398 WebInspector.SourcesPanel.instance = function()
1399 { 1399 {
1400 if (!WebInspector.SourcesPanel._instanceObject) 1400 if (!WebInspector.SourcesPanel._instanceObject)
1401 WebInspector.SourcesPanel._instanceObject = new WebInspector.SourcesPane l(); 1401 WebInspector.SourcesPanel._instanceObject = new WebInspector.SourcesPane l();
1402 return WebInspector.SourcesPanel._instanceObject; 1402 return WebInspector.SourcesPanel._instanceObject;
1403 } 1403 }
1404 1404
1405 /** 1405 /**
1406 * @param {!WebInspector.SourcesPanel} panel
1407 */
1408 WebInspector.SourcesPanel.updateResizer = function(panel)
1409 {
1410 if (panel._splitWidget.isVertical() || (WebInspector.SourcesPanel.WrapperVie w.isShowing() && !WebInspector.inspectorView.isDrawerMinimized()))
1411 panel._splitWidget.uninstallResizer(panel._sourcesView.toolbarContainerE lement());
1412 else
1413 panel._splitWidget.installResizer(panel._sourcesView.toolbarContainerEle ment());
1414 }
1415
1416 /**
1406 * @constructor 1417 * @constructor
1407 * @implements {WebInspector.PanelFactory} 1418 * @implements {WebInspector.PanelFactory}
1408 */ 1419 */
1409 WebInspector.SourcesPanelFactory = function() 1420 WebInspector.SourcesPanelFactory = function()
1410 { 1421 {
1411 } 1422 }
1412 1423
1413 WebInspector.SourcesPanelFactory.prototype = { 1424 WebInspector.SourcesPanelFactory.prototype = {
1414 /** 1425 /**
1415 * @override 1426 * @override
(...skipping 17 matching lines...) Expand all
1433 this._view = WebInspector.SourcesPanel.instance()._sourcesView; 1444 this._view = WebInspector.SourcesPanel.instance()._sourcesView;
1434 } 1445 }
1435 1446
1436 WebInspector.SourcesPanel.WrapperView.prototype = { 1447 WebInspector.SourcesPanel.WrapperView.prototype = {
1437 wasShown: function() 1448 wasShown: function()
1438 { 1449 {
1439 if (WebInspector.inspectorView.currentPanel() && WebInspector.inspectorV iew.currentPanel().name !== "sources") 1450 if (WebInspector.inspectorView.currentPanel() && WebInspector.inspectorV iew.currentPanel().name !== "sources")
1440 this._showViewInWrapper(); 1451 this._showViewInWrapper();
1441 else 1452 else
1442 WebInspector.inspectorView.setDrawerMinimized(true); 1453 WebInspector.inspectorView.setDrawerMinimized(true);
1454 WebInspector.SourcesPanel.updateResizer(WebInspector.SourcesPanel.instan ce());
1443 }, 1455 },
1444 1456
1445 willHide: function() 1457 willHide: function()
1446 { 1458 {
1447 WebInspector.inspectorView.setDrawerMinimized(false); 1459 WebInspector.inspectorView.setDrawerMinimized(false);
1460 setImmediate(() => WebInspector.SourcesPanel.updateResizer(WebInspector. SourcesPanel.instance()));
1448 }, 1461 },
1449 1462
1450 /** 1463 /**
1451 * @override 1464 * @override
1452 * @return {!Element} 1465 * @return {!Element}
1453 */ 1466 */
1454 defaultFocusedElement: function() 1467 defaultFocusedElement: function()
1455 { 1468 {
1456 return this._view.defaultFocusedElement(); 1469 return this._view.defaultFocusedElement();
1457 }, 1470 },
1458 1471
1459 focus: function() 1472 focus: function()
1460 { 1473 {
1461 this._view.focus(); 1474 this._view.focus();
1462 }, 1475 },
1463 1476
1464 _showViewInWrapper: function() 1477 _showViewInWrapper: function()
1465 { 1478 {
1466 this._view.show(this.element); 1479 this._view.show(this.element);
1467 }, 1480 },
1468 1481
1469 __proto__: WebInspector.VBox.prototype 1482 __proto__: WebInspector.VBox.prototype
1470 } 1483 }
1484
1485 /**
1486 * @return {boolean}
1487 */
1488 WebInspector.SourcesPanel.WrapperView.isShowing = function()
1489 {
1490 return !!WebInspector.SourcesPanel.WrapperView._instance && WebInspector.Sou rcesPanel.WrapperView._instance.isShowing();
1491 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/ui/InspectorView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698