From: Alexander Ebert Date: Mon, 18 May 2015 15:27:16 +0000 (+0200) Subject: Fixed popover on page unload X-Git-Tag: 3.0.0_Beta_1~2393 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=40c7341c23712355494cace436533330fb5cae12;p=GitHub%2FWoltLab%2FWCF.git Fixed popover on page unload --- diff --git a/wcfsetup/install/files/js/WoltLab/WCF/Controller/Popover.js b/wcfsetup/install/files/js/WoltLab/WCF/Controller/Popover.js index b0207aa8ed..80a13d0c24 100644 --- a/wcfsetup/install/files/js/WoltLab/WCF/Controller/Popover.js +++ b/wcfsetup/install/files/js/WoltLab/WCF/Controller/Popover.js @@ -15,6 +15,7 @@ define(['Dictionary', 'DOM/Util', 'UI/Alignment'], function(Dictionary, DOMUtil, var _elements = null; var _handlers = null; var _hoverId = null; + var _suspended = false; var _timeoutEnter = null; var _timeoutLeave = null; @@ -88,6 +89,11 @@ define(['Dictionary', 'DOM/Util', 'UI/Alignment'], function(Dictionary, DOMUtil, window.addEventListener('beforeunload', (function() { _suspended = true; + + if (_timeoutEnter !== null) { + window.clearTimeout(_timeoutEnter); + } + this._hide(true); }).bind(this)); @@ -228,6 +234,10 @@ define(['Dictionary', 'DOM/Util', 'UI/Alignment'], function(Dictionary, DOMUtil, * @param {object} event event object */ _mouseEnter: function(event) { + if (_suspended) { + return; + } + if (_timeoutEnter !== null) { window.clearTimeout(_timeoutEnter); _timeoutEnter = null;