1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 * @extends {WebInspector.VBox}
9 WebInspector
.RootView = function()
11 WebInspector
.VBox
.call(this);
13 this.element
.classList
.add("root-view");
14 this.element
.setAttribute("spellcheck", false);
17 WebInspector
.RootView
.prototype = {
19 * @param {!Document} document
21 attachToDocument: function(document
)
23 document
.defaultView
.addEventListener("resize", this.doResize
.bind(this), false);
24 this._window
= document
.defaultView
;
26 this.show(document
.body
);
32 var size
= this.constraints().minimum
;
33 var zoom
= WebInspector
.zoomManager
.zoomFactor();
34 var right
= Math
.min(0, this._window
.innerWidth
- size
.width
/ zoom
);
35 this.element
.style
.marginRight
= right
+ "px";
36 var bottom
= Math
.min(0, this._window
.innerHeight
- size
.height
/ zoom
);
37 this.element
.style
.marginBottom
= bottom
+ "px";
39 WebInspector
.VBox
.prototype.doResize
.call(this);
42 __proto__
: WebInspector
.VBox
.prototype