Changeset 113428 in webkit
- Timestamp:
- Apr 6, 2012, 5:49:55 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r113426 r113428 1 2012-04-06 Andrey Kosyakov <caseq@chromium.org> 2 3 Web Inspector: hide popover on mouseout from anchor 4 https://bugs.webkit.org/show_bug.cgi?id=83362 5 6 Reviewed by Pavel Feldman. 7 8 - start hide popover timer when mouse moves out of popover anchor, as we won't receive mousemove events any more; 9 - factored out starting of popover kill timer to a method. 10 11 * inspector/front-end/Popover.js: 12 (WebInspector.PopoverHelper): 13 (WebInspector.PopoverHelper.prototype._mouseMove): Factored out StartHidePopoverTimer() 14 (WebInspector.PopoverHelper.prototype._mouseOut): Just call StartHidePopoverTimer() when mouse moves out of anchor. 15 (WebInspector.PopoverHelper.prototype._startHidePopoverTimer.doHide): 16 (WebInspector.PopoverHelper.prototype._startHidePopoverTimer): 17 (WebInspector.PopoverHelper.prototype._hidePopover): Reset hoverElement (aka anchor) when hiding popover. 18 1 19 2012-04-06 Andrey Kosyakov <caseq@chromium.org> 2 20 -
trunk/Source/WebCore/inspector/front-end/Popover.js
r111676 r113428 206 206 panelElement.addEventListener("mousedown", this._mouseDown.bind(this), false); 207 207 panelElement.addEventListener("mousemove", this._mouseMove.bind(this), false); 208 panelElement.addEventListener("mouseout", this._mouseOut.bind(this), false); 208 209 this.setTimeout(1000); 209 210 } … … 231 232 return; 232 233 234 this._startHidePopoverTimer(); 235 this._handleMouseAction(event, false); 236 }, 237 238 _mouseOut: function(event) 239 { 240 if (event.target === this._hoverElement) 241 this._startHidePopoverTimer(); 242 }, 243 244 _startHidePopoverTimer: function() 245 { 233 246 // User has 500ms (this._timeout / 2) to reach the popup. 234 if (this._popover && !this._hidePopoverTimer) { 235 var self = this; 236 function doHide() 237 { 238 self._hidePopover(); 239 delete self._hidePopoverTimer; 240 } 241 this._hidePopoverTimer = setTimeout(doHide, this._timeout / 2); 242 } 243 244 this._handleMouseAction(event, false); 247 if (!this._popover || this._hidePopoverTimer) 248 return; 249 250 function doHide() 251 { 252 this._hidePopover(); 253 delete this._hidePopoverTimer; 254 } 255 this._hidePopoverTimer = setTimeout(doHide.bind(this), this._timeout / 2); 245 256 }, 246 257 … … 286 297 this._popover.dispose(); 287 298 delete this._popover; 299 this._hoverElement = null; 288 300 }, 289 301
Note:
See TracChangeset
for help on using the changeset viewer.