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

Unified Diff: Source/devtools/front_end/InspectorView.js

Issue 197823010: [DevTools] Add minimum size to WebInspector.View. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@splitdip2
Patch Set: fixed comments Created 6 years, 9 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 | « Source/devtools/front_end/InspectedPagePlaceholder.js ('k') | Source/devtools/front_end/Main.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/InspectorView.js
diff --git a/Source/devtools/front_end/InspectorView.js b/Source/devtools/front_end/InspectorView.js
index cb1ffaa19252b8d982c28526bdc8d947fe3c0c27..e27be2eac39882241984bb9f676782db40c000f5 100644
--- a/Source/devtools/front_end/InspectorView.js
+++ b/Source/devtools/front_end/InspectorView.js
@@ -36,13 +36,12 @@ WebInspector.InspectorView = function()
{
WebInspector.VBox.call(this);
WebInspector.Dialog.setModalHostView(this);
+ this.setMinimumSize(180, 72);
// DevTools sidebar is a vertical split of panels tabbed pane and a drawer.
this._drawerSplitView = new WebInspector.SplitView(false, true, "Inspector.drawerSplitViewState", 200, 200);
this._drawerSplitView.hideSidebar();
this._drawerSplitView.enableShowModeSaving();
- this._drawerSplitView.setSidebarElementConstraints(Preferences.minDrawerHeight, Preferences.minDrawerHeight);
- this._drawerSplitView.setMainElementConstraints(25, 25);
this._drawerSplitView.show(this.element);
this._tabbedPane = new WebInspector.TabbedPane();
@@ -440,11 +439,44 @@ WebInspector.RootView = function()
{
WebInspector.VBox.call(this);
this.markAsRoot();
- this.element.classList.add("fill", "root-view");
+ this.element.classList.add("root-view");
this.element.setAttribute("spellcheck", false);
window.addEventListener("resize", this.doResize.bind(this), true);
+ this._onScrollBound = this._onScroll.bind(this);
};
WebInspector.RootView.prototype = {
+ attachToBody: function()
+ {
+ this.doResize();
+ this.show(document.body);
+ },
+
+ _onScroll: function()
+ {
+ // If we didn't have enough space at the start, we may have wrong scroll offsets.
+ if (document.body.scrollTop !== 0)
+ document.body.scrollTop = 0;
+ if (document.body.scrollLeft !== 0)
+ document.body.scrollLeft = 0;
+ },
+
+ doResize: function()
+ {
+ var size = this.minimumSize();
+ var right = Math.min(0, window.innerWidth - size.width);
+ this.element.style.right = right + "px";
+ var bottom = Math.min(0, window.innerHeight - size.height);
+ this.element.style.bottom = bottom + "px";
+
+ if (window.innerWidth < size.width || window.innerHeight < size.height)
+ window.addEventListener("scroll", this._onScrollBound, false);
+ else
+ window.removeEventListener("scroll", this._onScrollBound, false);
+
+ WebInspector.VBox.prototype.doResize.call(this);
+ this._onScroll();
+ },
+
__proto__: WebInspector.VBox.prototype
};
« no previous file with comments | « Source/devtools/front_end/InspectedPagePlaceholder.js ('k') | Source/devtools/front_end/Main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698