diff options
author | Sam Potts <sam@potts.es> | 2018-05-28 10:19:07 +1000 |
---|---|---|
committer | Sam Potts <sam@potts.es> | 2018-05-28 10:19:07 +1000 |
commit | 90c5735904354f5fde0dcdae9f8894fe9088739c (patch) | |
tree | a849f027e24a7e6a3efad45acb4ab192f25b3804 /src/js/utils.js | |
parent | cd51788b980a7bc7b5caaf2d595d2077be4138f5 (diff) | |
download | plyr-90c5735904354f5fde0dcdae9f8894fe9088739c.tar.lz plyr-90c5735904354f5fde0dcdae9f8894fe9088739c.tar.xz plyr-90c5735904354f5fde0dcdae9f8894fe9088739c.zip |
WIP
Diffstat (limited to 'src/js/utils.js')
-rw-r--r-- | src/js/utils.js | 22 |
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)) { |