aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/utils.js')
-rw-r--r--src/js/utils.js22
1 files changed, 0 insertions, 22 deletions
diff --git a/src/js/utils.js b/src/js/utils.js
index 0c5a28d7..201c06c8 100644
--- a/src/js/utils.js
+++ b/src/js/utils.js
@@ -572,28 +572,6 @@ const utils = {
element.dispatchEvent(event);
},
- // Toggle aria-pressed state on a toggle button
- // http://www.ssbbartgroup.com/blog/how-not-to-misuse-aria-states-properties-and-roles
- toggleState(element, input) {
- // If multiple elements passed
- if (utils.is.array(element) || utils.is.nodeList(element)) {
- Array.from(element).forEach(target => utils.toggleState(target, input));
- return;
- }
-
- // Bail if no target
- if (!utils.is.element(element)) {
- return;
- }
-
- // Get state
- const pressed = element.getAttribute('aria-pressed') === 'true';
- const state = utils.is.boolean(input) ? input : !pressed;
-
- // Set the attribute on target
- element.setAttribute('aria-pressed', state);
- },
-
// Format string
format(input, ...args) {
if (utils.is.empty(input)) {