Home | History | Annotate | Download | only in ui
      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.
      4 
      5 /**
      6  * @constructor
      7  * @extends {WebInspector.VBox}
      8  */
      9 WebInspector.RootView = function()
     10 {
     11     WebInspector.VBox.call(this);
     12     this.markAsRoot();
     13     this.element.classList.add("root-view");
     14     this.element.setAttribute("spellcheck", false);
     15     window.addEventListener("resize", this.doResize.bind(this), false);
     16 }
     17 
     18 WebInspector.RootView.prototype = {
     19     attachToBody: function()
     20     {
     21         this.doResize();
     22         this.show(document.body);
     23     },
     24 
     25     doResize: function()
     26     {
     27         var size = this.constraints().minimum;
     28         var zoom = WebInspector.zoomManager.zoomFactor();
     29         var right = Math.min(0, window.innerWidth - size.width / zoom);
     30         this.element.style.marginRight = right + "px";
     31         var bottom = Math.min(0, window.innerHeight - size.height / zoom);
     32         this.element.style.marginBottom = bottom + "px";
     33         WebInspector.VBox.prototype.doResize.call(this);
     34     },
     35 
     36     __proto__: WebInspector.VBox.prototype
     37 }
     38