Demo/bin/Debug/front_end/elements/StylesPopoverHelper.js
(开头部分) 10KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
// Copyright (c) 2015 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.Object}
*/
WebInspector.StylesPopoverHelper = function()
{
this._popover = new WebInspector.Popover();
this._popover.setCanShrink(false);
this._popover.setNoMargins(true);
this._popover.element.addEventListener("mousedown", consumeEvent, false);
this._hideProxy = this.hide.bind(this, true);
this._boundOnKeyDown = this._onKeyDown.bind(this);
this._repositionBound = this._reposition.bind(this);
this._boundFocusOut = this._onFocusOut.bind(this);
}
WebInspector.StylesPopoverHelper.prototype = {
/**
* @param {!Event} event
*/
_onFocusOut: function(event)
{
if (!event.relatedTarget || event.relatedTarget.isSelfOrDescendant(this._view.contentElement))
return;
this._hideProxy();
},
/**
* @return {boolean}
*/
isShowing: function()
{
return this._popover.isShowing();
},
/**
* @param {!WebInspector.Widget} view
* @param {!Element} anchorElement
* @param {function(boolean)=} hiddenCallback
*/
show: function(view, anchorElement, hiddenCallback)
{
if (this._popover.isShowing()) {
if (this._anchorElement === anchorElement)
return;
// Reopen the picker for another anchor element.
this.hide(true);
}
delete this._isHidden;
this._anchorElement = anchorElement;
this._view = view;
this._hiddenCallback = hiddenCallback;
this._reposition();
后面还有 265 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。