ledgerrb/public/app/bower_components/angular-aria/angular-aria.min.js

13 lines
2.9 KiB
JavaScript
Raw Normal View History

/*
2015-02-04 16:08:32 +01:00
AngularJS v1.3.12
(c) 2010-2014 Google, Inc. http://angularjs.org
License: MIT
*/
2015-02-04 16:08:32 +01:00
(function(p,k,q){'use strict';k.module("ngAria",["ng"]).provider("$aria",function(){function b(b,e,c){return function(d,h,f){var l=f.$normalize(e);a[l]&&!f[l]&&d.$watch(f[b],function(d){c&&(d=!d);h.attr(e,d)})}}var a={ariaHidden:!0,ariaChecked:!0,ariaDisabled:!0,ariaRequired:!0,ariaInvalid:!0,ariaMultiline:!0,ariaValue:!0,tabindex:!0,bindKeypress:!0};this.config=function(b){a=k.extend(a,b)};this.$get=function(){return{config:function(b){return a[b]},$$watchExpr:b}}}).directive("ngShow",["$aria",function(b){return b.$$watchExpr("ngShow",
"aria-hidden",!0)}]).directive("ngHide",["$aria",function(b){return b.$$watchExpr("ngHide","aria-hidden",!1)}]).directive("ngModel",["$aria",function(b){function a(a,c,d){return b.config(c)&&!d.attr(a)}function g(b,c){var d=b.type,a=b.role;return"checkbox"===(d||a)||"menuitemcheckbox"===a?"checkbox":"radio"===(d||a)||"menuitemradio"===a?"radio":"range"===d||"progressbar"===a||"slider"===a?"range":"textbox"===(d||a)||"TEXTAREA"===c[0].nodeName?"multiline":""}return{restrict:"A",require:"?ngModel",
link:function(e,c,d,h){function f(){return h.$modelValue}function l(){return m?(m=!1,function(a){a=a===d.value;c.attr("aria-checked",a);c.attr("tabindex",0-!a)}):function(a){c.attr("aria-checked",a===d.value)}}function n(a){c.attr("aria-checked",!!a)}var k=g(d,c),m=a("tabindex","tabindex",c);switch(k){case "radio":case "checkbox":a("aria-checked","ariaChecked",c)&&e.$watch(f,"radio"===k?l():n);break;case "range":b.config("ariaValue")&&(d.min&&!c.attr("aria-valuemin")&&c.attr("aria-valuemin",d.min),
d.max&&!c.attr("aria-valuemax")&&c.attr("aria-valuemax",d.max),c.attr("aria-valuenow")||e.$watch(f,function(a){c.attr("aria-valuenow",a)}));break;case "multiline":a("aria-multiline","ariaMultiline",c)&&c.attr("aria-multiline",!0)}m&&c.attr("tabindex",0);h.$validators.required&&a("aria-required","ariaRequired",c)&&e.$watch(function(){return h.$error.required},function(a){c.attr("aria-required",!!a)});a("aria-invalid","ariaInvalid",c)&&e.$watch(function(){return h.$invalid},function(a){c.attr("aria-invalid",
!!a)})}}}]).directive("ngDisabled",["$aria",function(b){return b.$$watchExpr("ngDisabled","aria-disabled")}]).directive("ngMessages",function(){return{restrict:"A",require:"?ngMessages",link:function(b,a,g,e){a.attr("aria-live")||a.attr("aria-live","assertive")}}}).directive("ngClick",["$aria","$parse",function(b,a){return{restrict:"A",compile:function(g,e){var c=a(e.ngClick,null,!0);return function(a,e,f){b.config("tabindex")&&!e.attr("tabindex")&&e.attr("tabindex",0);if(b.config("bindKeypress")&&
!f.ngKeypress)e.on("keypress",function(b){function e(){c(a,{$event:b})}32!==b.keyCode&&13!==b.keyCode||a.$apply(e)})}}}}]).directive("ngDblclick",["$aria",function(b){return function(a,g,e){b.config("tabindex")&&!g.attr("tabindex")&&g.attr("tabindex",0)}}])})(window,window.angular);
//# sourceMappingURL=angular-aria.min.js.map