-
Notifications
You must be signed in to change notification settings - Fork 48
/
ngActivityIndicator.min.js
2 lines (2 loc) · 1.84 KB
/
ngActivityIndicator.min.js
1
2
/*! ngactivityindicator - v0.1.10 (https://github.com/voronianski/ngActivityIndicator) */
!function(a,b){"undefined"!=typeof module&&module.exports?module.exports=b(require("angular")):"function"==typeof define&&define.amd?define(["angular"],b):b(a.angular)}(this,function(a){"use strict";var b="CircledGrey",c={Circled:'<div ng-show="AILoading" class="ai-circled ai-indicator"></div>',Dotted:'<div ng-show="AILoading" class="ai-dotted ai-indicator"><span class="ai-inner1"></span><span class="ai-inner2"></span><span class="ai-inner3"></span></div>',Spinner:'<div ng-show="AILoading" class="ai-spinner ai-indicator"><div class="ai-bar1"></div><div class="ai-bar2"></div><div class="ai-bar3"></div><div class="ai-bar4"></div><div class="ai-bar5"></div><div class="ai-bar6"></div><div class="ai-bar7"></div><div class="ai-bar8"></div><div class="ai-bar7"></div><div class="ai-bar8"></div><div class="ai-bar9"></div><div class="ai-bar10"></div></div>'},d=function(b,d){var e=b.match(/([A-Z]?[^A-Z]*)/g).slice(0,-1),f=e[0],g=e[1].toLowerCase(),h=a.element(c[f]);return h.addClass("Circled"===f?"ai-"+g+"-spin":"ai-"+g+"-parent"),d&&h.removeAttr("ng-show"),h};return a.module("ngActivityIndicator",[]).provider("$activityIndicator",function(){this.setActivityIndicatorStyle=function(a){b=a||b},this.$get=["$rootScope","$timeout",function(a,b){var c,d={startAnimating:function(){return b.cancel(c),a.AILoading=!0,d},stopAnimating:function(e){function f(){b.cancel(c),a.AILoading=!1}return e&&"number"==typeof e?(c=b(f,e),d):f()},isAnimating:function(){return a.AILoading||!1}};return d}]}).directive("ngActivityIndicator",function(){return{restrict:"AE",compile:function(c,e){var f=e.ngActivityIndicator||b,g=e.skipNgShow&&"yes"===e.skipNgShow?!0:!1,h=d(f,g);if("BODY"===c[0].nodeName){var i=a.element(document.querySelectorAll("[ng-view]"));i.attr("ng-hide","AILoading")}c.append(h)}}})});