MediaWiki:Common.js: Difference between revisions

From Yogstation-13
Jump to navigation Jump to search
(Fixes tooltips on firefox for real now)
 
(Only remove the css rule after the reflow ahppened)
Line 5: Line 5:
if($(".tooltip").length) {
if($(".tooltip").length) {
   document.styleSheets[0].insertRule(".tooltiptext {top:0}");
   document.styleSheets[0].insertRule(".tooltiptext {top:0}");
   document.styleSheets[0].deleteRule(0);
   window.requestAnimationFrame(function() {
    document.styleSheets[0].deleteRule(0);
  })
}
}

Revision as of 21:48, 27 July 2022

/* Any JavaScript here will be loaded for all users on every page load. */


/* Firefox tooltip patch. Forces a reflow or something */
if($(".tooltip").length) {
  document.styleSheets[0].insertRule(".tooltiptext {top:0}");
  window.requestAnimationFrame(function() {
    document.styleSheets[0].deleteRule(0);
  })
}