Completely updated React, fixed #11, (hopefully)
This commit is contained in:
45
goTorrentWebUI/node_modules/material-ui/Modal/manageAriaHidden.js
generated
vendored
Normal file
45
goTorrentWebUI/node_modules/material-ui/Modal/manageAriaHidden.js
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.ariaHidden = ariaHidden;
|
||||
exports.hideSiblings = hideSiblings;
|
||||
exports.showSiblings = showSiblings;
|
||||
var 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, function (node) {
|
||||
if (mount.indexOf(node) === -1 && isHidable(node)) {
|
||||
callback(node);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function ariaHidden(show, node) {
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
if (show) {
|
||||
node.setAttribute('aria-hidden', 'true');
|
||||
} else {
|
||||
node.removeAttribute('aria-hidden');
|
||||
}
|
||||
}
|
||||
|
||||
function hideSiblings(container, mountNode) {
|
||||
siblings(container, mountNode, function (node) {
|
||||
return ariaHidden(true, node);
|
||||
});
|
||||
}
|
||||
|
||||
function showSiblings(container, mountNode) {
|
||||
siblings(container, mountNode, function (node) {
|
||||
return ariaHidden(false, node);
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user