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 titleText = $this.find('span').attr('title'); // Get title from the inner span
     var $innerSpan = $this.find('span');
     $this.find('span').removeAttr('title'); // Temporarily remove the title attribute from the inner 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(); // Get text from the tooltip
    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();
       $this.find('span').attr('title', tooltipText); // Add the title back to the inner span
       $innerSpan.attr('title', $innerSpan.data('original-title')); // Restore the original title
     });
     });
   }).on('mousemove', function(e) {
   }).on('mousemove', function(e) {