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

Unified Diff: Source/devtools/front_end/ui/RootView.js

Issue 675753002: [DevTools] Drop "ui" module from toolbox. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 6 years, 2 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/ui/Popover.js ('k') | Source/devtools/front_end/ui/UIUtils.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ui/RootView.js
diff --git a/Source/devtools/front_end/ui/RootView.js b/Source/devtools/front_end/ui/RootView.js
index 01fcb96293aa1da8cd2928de89a5374480acb2db..e4b5ef9bfb2ead634f523cbe3059910f063cf654 100644
--- a/Source/devtools/front_end/ui/RootView.js
+++ b/Source/devtools/front_end/ui/RootView.js
@@ -5,7 +5,6 @@
/**
* @constructor
* @extends {WebInspector.VBox}
- * @suppressGlobalPropertiesCheck
*/
WebInspector.RootView = function()
{
@@ -13,29 +12,30 @@ WebInspector.RootView = function()
this.markAsRoot();
this.element.classList.add("root-view");
this.element.setAttribute("spellcheck", false);
- // This view is not designed to change owner document.
- window.addEventListener("resize", this.doResize.bind(this), false);
}
WebInspector.RootView.prototype = {
/**
- * @public // FIXME: this is a workaround for validator bug (http://crbug.com/425506).
- * @suppressGlobalPropertiesCheck
+ * @param {!Document} document
*/
- attachToBody: function()
+ attachToDocument: function(document)
{
+ document.defaultView.addEventListener("resize", this.doResize.bind(this), false);
+ this._window = document.defaultView;
this.doResize();
this.show(document.body);
},
doResize: function()
{
- var size = this.constraints().minimum;
- var zoom = WebInspector.zoomManager.zoomFactor();
- var right = Math.min(0, window.innerWidth - size.width / zoom);
- this.element.style.marginRight = right + "px";
- var bottom = Math.min(0, window.innerHeight - size.height / zoom);
- this.element.style.marginBottom = bottom + "px";
+ if (this._window) {
+ var size = this.constraints().minimum;
+ var zoom = WebInspector.zoomManager.zoomFactor();
+ var right = Math.min(0, this._window.innerWidth - size.width / zoom);
+ this.element.style.marginRight = right + "px";
+ var bottom = Math.min(0, this._window.innerHeight - size.height / zoom);
+ this.element.style.marginBottom = bottom + "px";
+ }
WebInspector.VBox.prototype.doResize.call(this);
},
« no previous file with comments | « Source/devtools/front_end/ui/Popover.js ('k') | Source/devtools/front_end/ui/UIUtils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698