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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js b/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js
index 6c7627f4c3c75339d8e7f690ffbd0823fb51a4f8..f4bef520da7b59be744c2975fdfcbf84505c7ad5 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js
@@ -173,8 +173,10 @@ WebInspector.SourcesPanel.prototype = {
WebInspector.context.setFlavor(WebInspector.SourcesPanel, this);
WebInspector.Panel.prototype.wasShown.call(this);
var wrapper = WebInspector.SourcesPanel.WrapperView._instance;
- if (wrapper && wrapper.isShowing())
+ if (wrapper && wrapper.isShowing()) {
WebInspector.inspectorView.setDrawerMinimized(true);
+ WebInspector.SourcesPanel.updateResizer(this);
+ }
this.editorView.setMainWidget(this._sourcesView);
},
@@ -182,9 +184,10 @@ WebInspector.SourcesPanel.prototype = {
{
WebInspector.Panel.prototype.willHide.call(this);
WebInspector.context.setFlavor(WebInspector.SourcesPanel, null);
- if (WebInspector.SourcesPanel.WrapperView._instance && WebInspector.SourcesPanel.WrapperView._instance.isShowing()) {
+ if (WebInspector.SourcesPanel.WrapperView.isShowing()) {
WebInspector.SourcesPanel.WrapperView._instance._showViewInWrapper();
WebInspector.inspectorView.setDrawerMinimized(false);
+ WebInspector.SourcesPanel.updateResizer(this);
}
},
@@ -193,7 +196,7 @@ WebInspector.SourcesPanel.prototype = {
*/
_ensureSourcesViewVisible: function()
{
- if (WebInspector.SourcesPanel.WrapperView._instance && WebInspector.SourcesPanel.WrapperView._instance.isShowing())
+ if (WebInspector.SourcesPanel.WrapperView.isShowing())
return true;
return this === WebInspector.inspectorView.setCurrentPanel(this);
},
@@ -1095,10 +1098,7 @@ WebInspector.SourcesPanel.prototype = {
this._splitWidget.setVertical(!vertically);
this._splitWidget.element.classList.toggle("sources-split-view-vertical", vertically);
- if (!vertically)
- this._splitWidget.uninstallResizer(this._sourcesView.toolbarContainerElement());
- else
- this._splitWidget.installResizer(this._sourcesView.toolbarContainerElement());
+ WebInspector.SourcesPanel.updateResizer(this);
// Create vertical box with stack.
var vbox = new WebInspector.VBox();
@@ -1403,6 +1403,17 @@ WebInspector.SourcesPanel.instance = function()
}
/**
+ * @param {!WebInspector.SourcesPanel} panel
+ */
+WebInspector.SourcesPanel.updateResizer = function(panel)
+{
+ if (panel._splitWidget.isVertical() || (WebInspector.SourcesPanel.WrapperView.isShowing() && !WebInspector.inspectorView.isDrawerMinimized()))
+ panel._splitWidget.uninstallResizer(panel._sourcesView.toolbarContainerElement());
+ else
+ panel._splitWidget.installResizer(panel._sourcesView.toolbarContainerElement());
+}
+
+/**
* @constructor
* @implements {WebInspector.PanelFactory}
*/
@@ -1440,11 +1451,13 @@ WebInspector.SourcesPanel.WrapperView.prototype = {
this._showViewInWrapper();
else
WebInspector.inspectorView.setDrawerMinimized(true);
+ WebInspector.SourcesPanel.updateResizer(WebInspector.SourcesPanel.instance());
},
willHide: function()
{
WebInspector.inspectorView.setDrawerMinimized(false);
+ setImmediate(() => WebInspector.SourcesPanel.updateResizer(WebInspector.SourcesPanel.instance()));
},
/**
@@ -1468,3 +1481,11 @@ WebInspector.SourcesPanel.WrapperView.prototype = {
__proto__: WebInspector.VBox.prototype
}
+
+/**
+ * @return {boolean}
+ */
+WebInspector.SourcesPanel.WrapperView.isShowing = function()
+{
+ return !!WebInspector.SourcesPanel.WrapperView._instance && WebInspector.SourcesPanel.WrapperView._instance.isShowing();
+}
« 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