MediaWiki:Common.js: Difference between revisions
mNo edit summary |
mNo edit summary |
||
| Line 112: | Line 112: | ||
$('.editorial-notation-tooltip').on('mouseover', function(e) { | $('.editorial-notation-tooltip').on('mouseover', function(e) { | ||
var $this = $(this); | var $this = $(this); | ||
var | var $innerSpan = $this.find('span'); | ||
$ | var titleText = $innerSpan.attr('title'); | ||
if (titleText) { | if (titleText) { | ||
| Line 124: | Line 124: | ||
position: 'absolute' | position: 'absolute' | ||
}).fadeIn('normal'); | }).fadeIn('normal'); | ||
$innerSpan.data('original-title', titleText).removeAttr('title'); // Store and remove title | |||
} | } | ||
}).on('mouseout', function() { | }).on('mouseout', function() { | ||
var $this = $(this); | var $this = $(this); | ||
var tooltipText = $('.editorial-notation-tooltip-box').text(); | var $innerSpan = $this.find('span'); | ||
var tooltipText = $('.editorial-notation-tooltip-box').text(); | |||
$('.editorial-notation-tooltip-box').fadeOut('normal', function() { | $('.editorial-notation-tooltip-box').fadeOut('normal', function() { | ||
$(this).remove(); | $(this).remove(); | ||
$ | $innerSpan.attr('title', $innerSpan.data('original-title')); // Restore the original title | ||
}); | }); | ||
}).on('mousemove', function(e) { | }).on('mousemove', function(e) { | ||