From: Marcel Werk Date: Wed, 2 Nov 2011 17:17:13 +0000 (+0100) Subject: Some javascript optimizations X-Git-Tag: 2.0.0_Beta_1~1634 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2a9d59c464ae5d7a750ad2e900033c85d954a891;p=GitHub%2FWoltLab%2FWCF.git Some javascript optimizations --- diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index d4e4e454e3..e22460e560 100644 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -2665,16 +2665,19 @@ WCF.Effect.BalloonTooltip.prototype = { this.tooltip = $('
').appendTo(document.body).hide(); // init elements - $('.balloonTooltip').each($.proxy(this._initTooltip, this)); + $('.balloonTooltip').live('mouseenter', $.proxy(this._initTooltip, this)); }, - _initTooltip: function(index, element) { - $(element).hover( + _initTooltip: function(event) { + $(event.currentTarget).die('mouseenter'); + $(event.currentTarget).removeClass('balloonTooltip'); + + $(event.currentTarget).hover( $.proxy(this._mouseEnterHandler, this), $.proxy(this._mouseLeaveHandler, this) ); - $(element).mousemove( + $(event.currentTarget).mousemove( $.proxy(this._mouseMoveHandler, this) ); },