From 59371e09a31ba42f6e0235effd083fd41adc3f78 Mon Sep 17 00:00:00 2001 From: boombuler Date: Fri, 1 Mar 2013 22:08:22 +0100 Subject: [PATCH] added some comments --- plugins/guess-player-levels.user.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/plugins/guess-player-levels.user.js b/plugins/guess-player-levels.user.js index b04e67a3..829f1e2d 100644 --- a/plugins/guess-player-levels.user.js +++ b/plugins/guess-player-levels.user.js @@ -48,7 +48,17 @@ window.plugin.guessPlayerLevels.setLevelTitle = function(dom) { text = 'Min player level unknown'; } window.setupTooltips(el); - el.addClass('help').attr('title', text).tooltip('open').attr('title', null); + + /* + This code looks hacky but since we are a little late within the mouseenter so + we need to improvise a little. The open method doesn't open the tooltip directly. + It starts the whole opening procedure (including the timeout etc) and is normally + started by the mousemove event of the enhanced element. + */ + el.addClass('help') // Add the "Help Mouse Cursor" + .attr('title', text) // Set the title for the jquery tooltip + .tooltip('open') // Start the "open" method + .attr('title', null); // And remove the title to prevent the browsers tooltip } window.plugin.guessPlayerLevels.setupChatNickHelper = function() {