Demo/bin/Debug/front_end/emulation/InspectedPagePlaceholder.js
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
// 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.Widget}
*/
WebInspector.InspectedPagePlaceholder = function()
{
WebInspector.Widget.call(this);
this.element.classList.add("inspected-page-placeholder");
WebInspector.zoomManager.addEventListener(WebInspector.ZoomManager.Events.ZoomChanged, this._scheduleUpdate, this);
this._margins = { top: 0, right: 0, bottom: 0, left: 0 };
this.restoreMinimumSizeAndMargins();
};
WebInspector.InspectedPagePlaceholder.Events = {
Update: "Update"
};
WebInspector.InspectedPagePlaceholder.MarginValue = 3;
WebInspector.InspectedPagePlaceholder.prototype = {
_findMargins: function()
{
var margins = { top: 0, right: 0, bottom: 0, left: 0 };
if (this._useMargins) {
var adjacent = { top: true, right: true, bottom: true, left: true };
var widget = this;
while (widget.parentWidget()) {
var parent = widget.parentWidget();
// This view assumes it's always inside the main split widget element, not a sidebar.
// Every parent which is not a split widget, must be of the same size as this widget.
if (parent instanceof WebInspector.SplitWidget) {
var side = parent.sidebarSide();
if (adjacent[side] && !parent.hasCustomResizer() && parent.isResizable())
margins[side] = WebInspector.InspectedPagePlaceholder.MarginValue;
adjacent[side] = false;
}
widget = parent;
}
}
if (this._margins.top !== margins.top || this._margins.left !== margins.left || this._margins.right !== margins.right || this._margins.bottom !== margins.bottom) {
this._margins = margins;
this._scheduleUpdate();
}
},
onResize: function()
{
this._findMargins();
this._scheduleUpdate();
},
_scheduleUpdate: function()
{
if (this._updateId)
后面还有 42 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。