OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @constructor | 6 * @constructor |
7 * @param {!Document} doc | 7 * @param {!Document} doc |
8 */ | 8 */ |
9 WebInspector.Tooltip = function(doc) | 9 WebInspector.Tooltip = function(doc) |
10 { | 10 { |
11 this.element = doc.body.createChild("div"); | 11 this.element = doc.body.createChild("div"); |
12 this._shadowRoot = WebInspector.createShadowRootWithCoreStyles(this.element)
; | 12 this._shadowRoot = WebInspector.createShadowRootWithCoreStyles(this.element)
; |
13 this._shadowRoot.appendChild(WebInspector.Widget.createStyleElement("ui/tool
tip.css")); | 13 this._shadowRoot.appendChild(WebInspector.Widget.createStyleElement("ui/tool
tip.css")); |
14 | 14 |
15 this._tooltipElement = this._shadowRoot.createChild("div", "tooltip"); | 15 this._tooltipElement = this._shadowRoot.createChild("div", "tooltip"); |
16 doc.addEventListener("mousemove", this._mouseMove.bind(this), false); | 16 doc.addEventListener("mousemove", this._mouseMove.bind(this), true); |
17 doc.addEventListener("mousedown", this._hide.bind(this), false); | 17 doc.addEventListener("mousedown", this._hide.bind(this), true); |
18 } | 18 } |
19 | 19 |
20 WebInspector.Tooltip.Timing = { | 20 WebInspector.Tooltip.Timing = { |
21 // Max time between tooltips showing that no opening delay is required. | 21 // Max time between tooltips showing that no opening delay is required. |
22 "InstantThreshold": 300, | 22 "InstantThreshold": 300, |
23 // Wait time before opening a tooltip. | 23 // Wait time before opening a tooltip. |
24 "OpeningDelay": 600 | 24 "OpeningDelay": 600 |
25 } | 25 } |
26 | 26 |
27 WebInspector.Tooltip.AlignmentOverride = { | 27 WebInspector.Tooltip.AlignmentOverride = { |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 | 152 |
153 /** | 153 /** |
154 * @param {!Element|string} x | 154 * @param {!Element|string} x |
155 * @this {!Element} | 155 * @this {!Element} |
156 */ | 156 */ |
157 set: function(x) | 157 set: function(x) |
158 { | 158 { |
159 WebInspector.Tooltip.install(this, x); | 159 WebInspector.Tooltip.install(this, x); |
160 } | 160 } |
161 }); | 161 }); |
OLD | NEW |