From 40c7341c23712355494cace436533330fb5cae12 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 18 May 2015 17:27:16 +0200 Subject: [PATCH] Fixed popover on page unload --- .../install/files/js/WoltLab/WCF/Controller/Popover.js | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; -- 2.20.1