From: Alexander Ebert Date: Thu, 25 Dec 2014 02:00:58 +0000 (+0100) Subject: Improved behavior for popovers on navigation X-Git-Tag: 2.1.0_Beta_3~87 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5b5ad8dd42836ae844e033f4a84bd8a46f99f6b4;p=GitHub%2FWoltLab%2FWCF.git Improved behavior for popovers on navigation --- diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index c6b3b060af..7f7832d3e5 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -9658,6 +9658,11 @@ WCF.Popover = Class.extend({ this._initContainers(); WCF.DOMNodeInsertedHandler.addCallback('WCF.Popover.'+selector, $.proxy(this._initContainers, this)); + + $(window).on('beforeunload', (function() { + this._cancelPopover = true; + this._hide(true); + }).bind(this)); }, /** @@ -9684,20 +9689,14 @@ WCF.Popover = Class.extend({ $element.hover($.proxy(this._overElement, this), $.proxy(this._out, this)); if ($element.is('a') && $element.attr('href')) { - $element.click($.proxy(this._cancel, this)); + $element.click((function() { + this._hide(true); + }).bind(this)); } } }, this)); }, - /** - * Cancels popovers if link is being clicked - */ - _cancel: function(event) { - this._cancelPopover = true; - this._hide(true); - }, - /** * Triggered once an element is being hovered. *