@ndla/article-scripts
Advanced tools
Comparing version 0.5.10 to 0.5.11
@@ -92,4 +92,5 @@ /** | ||
var parentFigure = target.closest('figure'); | ||
var sourceTag = parentFigure && parentFigure.getElementsByTagName('source')[0]; | ||
if (target.dataset.expanded) { | ||
if (parentFigure && target.dataset.expanded) { | ||
target.setAttribute('aria-label', target.dataset.aria); | ||
@@ -99,3 +100,4 @@ target.classList.remove('c-figure__fullscreen-btn--expanded'); | ||
delete target.dataset.expanded; | ||
} else { | ||
} else if (sourceTag) { | ||
sourceTag.setAttribute('sizes', '(min-width: 1024px) 1024px, 100vw'); | ||
target.setAttribute('aria-label', target.dataset.ariaexpanded); | ||
@@ -102,0 +104,0 @@ parentFigure.classList.remove(target.dataset.classtype); |
@@ -110,4 +110,5 @@ "use strict"; | ||
var parentFigure = target.closest('figure'); | ||
var sourceTag = parentFigure && parentFigure.getElementsByTagName('source')[0]; | ||
if (target.dataset.expanded) { | ||
if (parentFigure && target.dataset.expanded) { | ||
target.setAttribute('aria-label', target.dataset.aria); | ||
@@ -117,3 +118,4 @@ target.classList.remove('c-figure__fullscreen-btn--expanded'); | ||
delete target.dataset.expanded; | ||
} else { | ||
} else if (sourceTag) { | ||
sourceTag.setAttribute('sizes', '(min-width: 1024px) 1024px, 100vw'); | ||
target.setAttribute('aria-label', target.dataset.ariaexpanded); | ||
@@ -120,0 +122,0 @@ parentFigure.classList.remove(target.dataset.classtype); |
{ | ||
"name": "@ndla/article-scripts", | ||
"version": "0.5.10", | ||
"version": "0.5.11", | ||
"description": "A collection of functions for making article content responsive (and interactive)", | ||
@@ -30,3 +30,3 @@ "license": "GPL-3.0", | ||
}, | ||
"gitHead": "ffba847067bb684b37789a5fb071b5720d2e49cf" | ||
"gitHead": "cb68eba4d3b6df9ba20ec650a367a6ec15693bf8" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
109497
1749