Completely updated React, fixed #11, (hopefully)
This commit is contained in:
33
goTorrentWebUI/node_modules/material-ui/Modal/manageAriaHidden.js.flow
generated
vendored
Normal file
33
goTorrentWebUI/node_modules/material-ui/Modal/manageAriaHidden.js.flow
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
const BLACKLIST = ['template', 'script', 'style'];
|
||||
|
||||
function isHidable(node) {
|
||||
return node.nodeType === 1 && BLACKLIST.indexOf(node.tagName.toLowerCase()) === -1;
|
||||
}
|
||||
|
||||
function siblings(container, mount, callback) {
|
||||
mount = [].concat(mount); // eslint-disable-line no-param-reassign
|
||||
[].forEach.call(container.children, node => {
|
||||
if (mount.indexOf(node) === -1 && isHidable(node)) {
|
||||
callback(node);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function ariaHidden(show, node) {
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
if (show) {
|
||||
node.setAttribute('aria-hidden', 'true');
|
||||
} else {
|
||||
node.removeAttribute('aria-hidden');
|
||||
}
|
||||
}
|
||||
|
||||
export function hideSiblings(container, mountNode) {
|
||||
siblings(container, mountNode, node => ariaHidden(true, node));
|
||||
}
|
||||
|
||||
export function showSiblings(container, mountNode) {
|
||||
siblings(container, mountNode, node => ariaHidden(false, node));
|
||||
}
|
Reference in New Issue
Block a user