From 8c7950020f14f687db1171db18a0e17b969e31c8 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sat, 15 Feb 2020 23:01:01 +0000 Subject: [PATCH] Github CI lint - phpcbf --- resources/scripts/toc.js | 44 ++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/resources/scripts/toc.js b/resources/scripts/toc.js index da519638..93beb554 100644 --- a/resources/scripts/toc.js +++ b/resources/scripts/toc.js @@ -6,15 +6,15 @@ */ function SmoothScroll() { - var navLinks, eventListener, link; - if (!("scrollBehavior" in document.documentElement.style)) { - navLinks = document.querySelectorAll("#toc a"); - eventListener = function eventListener(e) { - e.preventDefault(); - e.target.scrollIntoView({ - behavior: "smooth" - }); - }; + var navLinks, eventListener, link; + if (!("scrollBehavior" in document.documentElement.style)) { + navLinks = document.querySelectorAll("#toc a"); + eventListener = function eventListener(e) { + e.preventDefault(); + e.target.scrollIntoView({ + behavior: "smooth" + }); + }; for (link in navLinks) { if (Object.prototype.hasOwnProperty.call(navLinks, link)) { @@ -25,20 +25,20 @@ function SmoothScroll() { } function ScrollSpy() { - var sections = document.querySelectorAll(".mw-headline"); - window.addEventListener("scroll", function() { - var scrollPos = document.documentElement.scrollTop || document.body.scrollTop, - sectionm id; + var sections = document.querySelectorAll(".mw-headline"); + window.addEventListener("scroll", function() { + var scrollPos = document.documentElement.scrollTop || document.body.scrollTop, + sectionm id; - for (section in sections) { - if ( - Object.prototype.hasOwnProperty.call(sections, section) && - sections[section].offsetTop <= scrollPos - ) { - id = mw.util.escapeIdForAttribute(sections[section].id), - node = document.querySelector('a[href * = "'.concat(id, '"]')) - .parentNode, - active = document.querySelector(".active"); + for (section in sections) { + if ( + Object.prototype.hasOwnProperty.call(sections, section) && + sections[section].offsetTop <= scrollPos + ) { + id = mw.util.escapeIdForAttribute(sections[section].id), + node = document.querySelector('a[href * = "'.concat(id, '"]')) + .parentNode, + active = document.querySelector(".active"); if (active !== null) { active.classList.remove("active"); }