aria-hidden
Advanced tools
Comparing version 1.2.3 to 1.2.4
@@ -64,18 +64,23 @@ var getDefaultParent = function (originalTarget) { | ||
else { | ||
var attr = node.getAttribute(controlAttribute); | ||
var alreadyHidden = attr !== null && attr !== 'false'; | ||
var counterValue = (counterMap.get(node) || 0) + 1; | ||
var markerValue = (markerCounter.get(node) || 0) + 1; | ||
counterMap.set(node, counterValue); | ||
markerCounter.set(node, markerValue); | ||
hiddenNodes.push(node); | ||
if (counterValue === 1 && alreadyHidden) { | ||
uncontrolledNodes.set(node, true); | ||
try { | ||
var attr = node.getAttribute(controlAttribute); | ||
var alreadyHidden = attr !== null && attr !== 'false'; | ||
var counterValue = (counterMap.get(node) || 0) + 1; | ||
var markerValue = (markerCounter.get(node) || 0) + 1; | ||
counterMap.set(node, counterValue); | ||
markerCounter.set(node, markerValue); | ||
hiddenNodes.push(node); | ||
if (counterValue === 1 && alreadyHidden) { | ||
uncontrolledNodes.set(node, true); | ||
} | ||
if (markerValue === 1) { | ||
node.setAttribute(markerName, 'true'); | ||
} | ||
if (!alreadyHidden) { | ||
node.setAttribute(controlAttribute, 'true'); | ||
} | ||
} | ||
if (markerValue === 1) { | ||
node.setAttribute(markerName, 'true'); | ||
catch (e) { | ||
console.error('aria-hidden: cannot operate on ', node, e); | ||
} | ||
if (!alreadyHidden) { | ||
node.setAttribute(controlAttribute, 'true'); | ||
} | ||
} | ||
@@ -82,0 +87,0 @@ }); |
@@ -60,18 +60,23 @@ const getDefaultParent = (originalTarget) => { | ||
else { | ||
const attr = node.getAttribute(controlAttribute); | ||
const alreadyHidden = attr !== null && attr !== 'false'; | ||
const counterValue = (counterMap.get(node) || 0) + 1; | ||
const markerValue = (markerCounter.get(node) || 0) + 1; | ||
counterMap.set(node, counterValue); | ||
markerCounter.set(node, markerValue); | ||
hiddenNodes.push(node); | ||
if (counterValue === 1 && alreadyHidden) { | ||
uncontrolledNodes.set(node, true); | ||
try { | ||
const attr = node.getAttribute(controlAttribute); | ||
const alreadyHidden = attr !== null && attr !== 'false'; | ||
const counterValue = (counterMap.get(node) || 0) + 1; | ||
const markerValue = (markerCounter.get(node) || 0) + 1; | ||
counterMap.set(node, counterValue); | ||
markerCounter.set(node, markerValue); | ||
hiddenNodes.push(node); | ||
if (counterValue === 1 && alreadyHidden) { | ||
uncontrolledNodes.set(node, true); | ||
} | ||
if (markerValue === 1) { | ||
node.setAttribute(markerName, 'true'); | ||
} | ||
if (!alreadyHidden) { | ||
node.setAttribute(controlAttribute, 'true'); | ||
} | ||
} | ||
if (markerValue === 1) { | ||
node.setAttribute(markerName, 'true'); | ||
catch (e) { | ||
console.error('aria-hidden: cannot operate on ', node, e); | ||
} | ||
if (!alreadyHidden) { | ||
node.setAttribute(controlAttribute, 'true'); | ||
} | ||
} | ||
@@ -78,0 +83,0 @@ }); |
@@ -67,18 +67,23 @@ "use strict"; | ||
else { | ||
var attr = node.getAttribute(controlAttribute); | ||
var alreadyHidden = attr !== null && attr !== 'false'; | ||
var counterValue = (counterMap.get(node) || 0) + 1; | ||
var markerValue = (markerCounter.get(node) || 0) + 1; | ||
counterMap.set(node, counterValue); | ||
markerCounter.set(node, markerValue); | ||
hiddenNodes.push(node); | ||
if (counterValue === 1 && alreadyHidden) { | ||
uncontrolledNodes.set(node, true); | ||
try { | ||
var attr = node.getAttribute(controlAttribute); | ||
var alreadyHidden = attr !== null && attr !== 'false'; | ||
var counterValue = (counterMap.get(node) || 0) + 1; | ||
var markerValue = (markerCounter.get(node) || 0) + 1; | ||
counterMap.set(node, counterValue); | ||
markerCounter.set(node, markerValue); | ||
hiddenNodes.push(node); | ||
if (counterValue === 1 && alreadyHidden) { | ||
uncontrolledNodes.set(node, true); | ||
} | ||
if (markerValue === 1) { | ||
node.setAttribute(markerName, 'true'); | ||
} | ||
if (!alreadyHidden) { | ||
node.setAttribute(controlAttribute, 'true'); | ||
} | ||
} | ||
if (markerValue === 1) { | ||
node.setAttribute(markerName, 'true'); | ||
catch (e) { | ||
console.error('aria-hidden: cannot operate on ', node, e); | ||
} | ||
if (!alreadyHidden) { | ||
node.setAttribute(controlAttribute, 'true'); | ||
} | ||
} | ||
@@ -85,0 +90,0 @@ }); |
{ | ||
"name": "aria-hidden", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"description": "Cast aria-hidden to everything, except...", | ||
@@ -5,0 +5,0 @@ "main": "dist/es5/index.js", |
@@ -79,3 +79,3 @@ # aria-hidden | ||
Generally speaking the same can be archived by addressing `[aria-hidden]` nodes, but | ||
Generally speaking the same can be achieved by addressing `[aria-hidden]` nodes, but | ||
not all `aria-hidden` nodes are expected to be non-interactive. | ||
@@ -82,0 +82,0 @@ Hence, it's better to separate concerns. |
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
30641
581