Demo/bin/Debug/front_end/ui/RootView.js

(完整代码) 1KB

// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/**
 * @constructor
 * @extends {WebInspector.VBox}
 */
WebInspector.RootView = function()
{
    WebInspector.VBox.call(this);
    this.markAsRoot();
    this.element.classList.add("root-view");
    this.element.setAttribute("spellcheck", false);
}

WebInspector.RootView.prototype = {
    /**
     * @param {!Document} document
     */
    attachToDocument: function(document)
    {
        document.defaultView.addEventListener("resize", this.doResize.bind(this), false);
        this._window = document.defaultView;
        this.doResize();
        this.show(document.body);
    },

    doResize: function()
    {
        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);
    },

    __proto__: WebInspector.VBox.prototype
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。