Loading core/misc/active-link.js +10 −15 Original line number Diff line number Diff line Loading @@ -50,24 +50,19 @@ // Add query string selector for pagers, exposed filters. selectors = selectors.map((current) => current + querySelector); // Query the DOM. const activeLinks = context.querySelectorAll(selectors.join(',')); const il = activeLinks.length; for (let i = 0; i < il; i++) { activeLinks[i].classList.add('is-active'); activeLinks[i].setAttribute('aria-current', 'page'); } context.querySelectorAll(selectors.join(',')).forEach((activeLink) => { activeLink.classList.add('is-active'); activeLink.setAttribute('aria-current', 'page'); }); }, detach(context, settings, trigger) { if (trigger === 'unload') { const activeLinks = context.querySelectorAll( '[data-drupal-link-system-path].is-active', ); const il = activeLinks.length; for (let i = 0; i < il; i++) { activeLinks[i].classList.remove('is-active'); activeLinks[i].removeAttribute('aria-current'); } context .querySelectorAll('[data-drupal-link-system-path].is-active') .forEach((activeLink) => { activeLink.classList.remove('is-active'); activeLink.removeAttribute('aria-current'); }); } }, }; Loading core/misc/displace.js +3 −8 Original line number Diff line number Diff line Loading @@ -153,15 +153,10 @@ */ function calculateOffset(edge) { let edgeOffset = 0; const displacingElements = document.querySelectorAll( `[data-offset-${edge}]`, ); const n = displacingElements.length; for (let i = 0; i < n; i++) { const el = displacingElements[i]; document.querySelectorAll(`[data-offset-${edge}]`).forEach((el) => { // If the element is not visible, do consider its dimensions. if (el.style.display === 'none') { continue; return; } // If the offset data attribute contains a displacing value, use it. let displacement = parseInt(el.getAttribute(`data-offset-${edge}`), 10); Loading @@ -175,7 +170,7 @@ // If the displacement value is larger than the current value for this // edge, use the displacement value. edgeOffset = Math.max(edgeOffset, displacement); } }); return edgeOffset; } Loading Loading
core/misc/active-link.js +10 −15 Original line number Diff line number Diff line Loading @@ -50,24 +50,19 @@ // Add query string selector for pagers, exposed filters. selectors = selectors.map((current) => current + querySelector); // Query the DOM. const activeLinks = context.querySelectorAll(selectors.join(',')); const il = activeLinks.length; for (let i = 0; i < il; i++) { activeLinks[i].classList.add('is-active'); activeLinks[i].setAttribute('aria-current', 'page'); } context.querySelectorAll(selectors.join(',')).forEach((activeLink) => { activeLink.classList.add('is-active'); activeLink.setAttribute('aria-current', 'page'); }); }, detach(context, settings, trigger) { if (trigger === 'unload') { const activeLinks = context.querySelectorAll( '[data-drupal-link-system-path].is-active', ); const il = activeLinks.length; for (let i = 0; i < il; i++) { activeLinks[i].classList.remove('is-active'); activeLinks[i].removeAttribute('aria-current'); } context .querySelectorAll('[data-drupal-link-system-path].is-active') .forEach((activeLink) => { activeLink.classList.remove('is-active'); activeLink.removeAttribute('aria-current'); }); } }, }; Loading
core/misc/displace.js +3 −8 Original line number Diff line number Diff line Loading @@ -153,15 +153,10 @@ */ function calculateOffset(edge) { let edgeOffset = 0; const displacingElements = document.querySelectorAll( `[data-offset-${edge}]`, ); const n = displacingElements.length; for (let i = 0; i < n; i++) { const el = displacingElements[i]; document.querySelectorAll(`[data-offset-${edge}]`).forEach((el) => { // If the element is not visible, do consider its dimensions. if (el.style.display === 'none') { continue; return; } // If the offset data attribute contains a displacing value, use it. let displacement = parseInt(el.getAttribute(`data-offset-${edge}`), 10); Loading @@ -175,7 +170,7 @@ // If the displacement value is larger than the current value for this // edge, use the displacement value. edgeOffset = Math.max(edgeOffset, displacement); } }); return edgeOffset; } Loading