a11y-dialog
Advanced tools
Comparing version 2.5.1 to 2.5.2
@@ -77,4 +77,4 @@ (function (global) { | ||
if (this.hasAttribute('aria-hidden')) { | ||
this.shown = !JSON.parse(this.getAttribute('aria-hidden')); | ||
if (node.hasAttribute('aria-hidden')) { | ||
this.shown = !JSON.parse(node.getAttribute('aria-hidden')); | ||
} | ||
@@ -81,0 +81,0 @@ |
@@ -1,1 +0,1 @@ | ||
!function(e){"use strict";function t(t,n,i){function o(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}o.prototype=e.Event.prototype;var a;a=e.CustomEvent&&"function"==typeof e.CustomEvent?new e.CustomEvent(n,{detail:i}):new o(n,{bubbles:!1,cancelable:!1,detail:i}),a&&t.dispatchEvent(a)}function n(e){var t=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])'];return i(t.join(","),e).filter(function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)})}function i(e,t){return Array.prototype.slice.call((t||document).querySelectorAll(e))}function o(e,t){var i=n(e),o=i.indexOf(document.activeElement);t.shiftKey&&0===o?(i[i.length-1].focus(),t.preventDefault()):t.shiftKey||o!==i.length-1||(i[0].focus(),t.preventDefault())}function a(e){var t=n(e);t.length&&t[0].focus()}var d,r=function(e,n){function r(t){l.shown&&27===t.which&&(t.preventDefault(),s()),l.shown&&9===t.which&&o(e,t)}function c(t){l.shown&&!e.contains(t.target)&&a(e)}function u(){l.shown=!0,e.removeAttribute("aria-hidden"),n.setAttribute("aria-hidden","true"),d=document.activeElement,a(e),document.body.addEventListener("focus",c,!0),document.addEventListener("keydown",r),t(e,"dialog:show",this)}function s(){l.shown=!1,e.setAttribute("aria-hidden","true"),n.removeAttribute("aria-hidden"),d&&d.focus(),document.body.removeEventListener("focus",c,!0),document.removeEventListener("keydown",r),t(e,"dialog:hide",this)}function f(){s(),h.forEach(function(e){e.removeEventListener("click",u)}),v.forEach(function(e){e.removeEventListener("click",s)})}n=n||document.querySelector("#main");var l=this,h=i('[data-a11y-dialog-show="'+e.id+'"]'),v=i("[data-a11y-dialog-hide]",e).concat(i('[data-a11y-dialog-hide="'+e.id+'"]'));this.hasAttribute("aria-hidden")&&(this.shown=!JSON.parse(this.getAttribute("aria-hidden"))),this.show=u,this.hide=s,this.destroy=f,h.forEach(function(e){e.addEventListener("click",u)}),v.forEach(function(e){e.addEventListener("click",s)})};"undefined"!=typeof module&&"undefined"!=typeof module.exports?module.exports=r:"function"==typeof define&&define.amd?define("A11yDialog",[],function(){return r}):"object"==typeof e&&(e.A11yDialog=r)}(window); | ||
!function(e){"use strict";function t(t,n,i){function o(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}o.prototype=e.Event.prototype;var a;a=e.CustomEvent&&"function"==typeof e.CustomEvent?new e.CustomEvent(n,{detail:i}):new o(n,{bubbles:!1,cancelable:!1,detail:i}),a&&t.dispatchEvent(a)}function n(e){var t=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])'];return i(t.join(","),e).filter(function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)})}function i(e,t){return Array.prototype.slice.call((t||document).querySelectorAll(e))}function o(e,t){var i=n(e),o=i.indexOf(document.activeElement);t.shiftKey&&0===o?(i[i.length-1].focus(),t.preventDefault()):t.shiftKey||o!==i.length-1||(i[0].focus(),t.preventDefault())}function a(e){var t=n(e);t.length&&t[0].focus()}var d,r=function(e,n){function r(t){l.shown&&27===t.which&&(t.preventDefault(),s()),l.shown&&9===t.which&&o(e,t)}function c(t){l.shown&&!e.contains(t.target)&&a(e)}function u(){l.shown=!0,e.removeAttribute("aria-hidden"),n.setAttribute("aria-hidden","true"),d=document.activeElement,a(e),document.body.addEventListener("focus",c,!0),document.addEventListener("keydown",r),t(e,"dialog:show",this)}function s(){l.shown=!1,e.setAttribute("aria-hidden","true"),n.removeAttribute("aria-hidden"),d&&d.focus(),document.body.removeEventListener("focus",c,!0),document.removeEventListener("keydown",r),t(e,"dialog:hide",this)}function f(){s(),h.forEach(function(e){e.removeEventListener("click",u)}),v.forEach(function(e){e.removeEventListener("click",s)})}n=n||document.querySelector("#main");var l=this,h=i('[data-a11y-dialog-show="'+e.id+'"]'),v=i("[data-a11y-dialog-hide]",e).concat(i('[data-a11y-dialog-hide="'+e.id+'"]'));e.hasAttribute("aria-hidden")&&(this.shown=!JSON.parse(e.getAttribute("aria-hidden"))),this.show=u,this.hide=s,this.destroy=f,h.forEach(function(e){e.addEventListener("click",u)}),v.forEach(function(e){e.addEventListener("click",s)})};"undefined"!=typeof module&&"undefined"!=typeof module.exports?module.exports=r:"function"==typeof define&&define.amd?define("A11yDialog",[],function(){return r}):"object"==typeof e&&(e.A11yDialog=r)}(window); |
{ | ||
"name": "a11y-dialog", | ||
"version": "2.5.1", | ||
"version": "2.5.2", | ||
"description": "A tiny script to make dialog windows accessible to assistive technology users.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/edenspiekermann/a11y-dialog", |
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
16887