From 2a9d59c464ae5d7a750ad2e900033c85d954a891 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Wed, 2 Nov 2011 18:17:13 +0100 Subject: [PATCH] Some javascript optimizations --- wcfsetup/install/files/js/WCF.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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) ); }, -- 2.20.1