From: Tim Düsterhus Date: Mon, 1 Jul 2019 17:51:13 +0000 (+0200) Subject: Properly honor the manual flag in prism X-Git-Tag: 5.2.0_Alpha_1~1^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c88e443d99fcb2b424a76399de648ef9339aad57;p=GitHub%2FWoltLab%2FWCF.git Properly honor the manual flag in prism --- diff --git a/wcfsetup/install/files/js/3rdParty/prism/prism.js b/wcfsetup/install/files/js/3rdParty/prism/prism.js index 18961e7180..d4e81a35fb 100644 --- a/wcfsetup/install/files/js/3rdParty/prism/prism.js +++ b/wcfsetup/install/files/js/3rdParty/prism/prism.js @@ -524,16 +524,24 @@ if (script) { _.filename = script.src; if (!_.manual && !script.hasAttribute('data-manual')) { + // WoltLab Start + _.highlightAutomaticallyCallback = function () { + if (!_.manual) { + _.highlightAll(); + } + } + if(document.readyState !== "loading") { if (window.requestAnimationFrame) { - window.requestAnimationFrame(_.highlightAll); + window.requestAnimationFrame(_.highlightAutomaticallyCallback); } else { - window.setTimeout(_.highlightAll, 16); + window.setTimeout(_.highlightAutomaticallyCallback, 16); } } else { - document.addEventListener('DOMContentLoaded', _.highlightAll); + document.addEventListener('DOMContentLoaded', _.highlightAutomaticallyCallback); } + // WoltLab End } }