Sha256: a4d9010f31e63be3646caf54a92272a373b3d21f6af42198226a50c8c54651df

Contents?: true

Size: 1.69 KB

Versions: 16

Compression:

Stored size: 1.69 KB

Contents

;(function (window) {
  var angular = window.angular;

  /** TEMPLATE /template/treasure-overlay-spinner/treasure-overlay-spinner.html
   *  <div class="treasure-overlay-spinner-content">
   *    <div class="treasure-overlay-spinner-container">
   *      <div class="treasure-overlay-spinner"></div>
   *    </div>
   *    <ng-transclude></ng-transclude>
   *  </div>
   */

  // constants
  var TEMPLATE_PATH = '/template/treasure-overlay-spinner/treasure-overlay-spinner.html';
  var TEMPLATE = '';
  TEMPLATE += '<div class="treasure-overlay-spinner-content">';
  TEMPLATE +=   '<div class="treasure-overlay-spinner-container">';
  TEMPLATE +=     '<div class="treasure-overlay-spinner"></div>';
  TEMPLATE +=   '</div>';
  TEMPLATE +=   '<ng-transclude></ng-transclude>';
  TEMPLATE += '</div>';

  // module
  angular.module('treasure-overlay-spinner', ['ngAnimate']);

  // directive
  angular.module('treasure-overlay-spinner').directive('treasureOverlaySpinner', overlaySpinner);
  overlaySpinner.$inject = ['$animate'];
  function overlaySpinner ($animate) {
    return {
      templateUrl: TEMPLATE_PATH,
      scope: {active: '='},
      transclude: true,
      restrict: 'E',
      link: link
    };

    function link (scope, iElement) {
      scope.$watch('active', statusWatcher);
      function statusWatcher (active) {
        $animate[active ? 'addClass' : 'removeClass'](iElement, 'treasure-overlay-spinner-active');
      }
    }
  }

  // template
  angular.module('treasure-overlay-spinner').run(overlaySpinnerTemplate);
  overlaySpinnerTemplate.$inject = ['$templateCache'];
  function overlaySpinnerTemplate ($templateCache) {
    $templateCache.put(TEMPLATE_PATH, TEMPLATE);
  }

}.call(this, window));

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
aleph_analytics-0.4.9.pre.dev vendor/assets/javascripts/angular-spinner/treasure-overlay-spinner.js
aleph_analytics-0.4.8 vendor/assets/javascripts/angular-spinner/treasure-overlay-spinner.js
aleph_analytics-0.4.7 vendor/assets/javascripts/angular-spinner/treasure-overlay-spinner.js
aleph_analytics-0.4.4 vendor/assets/javascripts/angular-spinner/treasure-overlay-spinner.js
aleph_analytics-0.4.2 vendor/assets/javascripts/angular-spinner/treasure-overlay-spinner.js
aleph_analytics-0.4.1 vendor/assets/javascripts/angular-spinner/treasure-overlay-spinner.js
aleph_analytics-0.3.0 vendor/assets/javascripts/angular-spinner/treasure-overlay-spinner.js
aleph_analytics-0.2.0 vendor/assets/javascripts/angular-spinner/treasure-overlay-spinner.js
aleph_analytics-0.1.0 vendor/assets/javascripts/angular-spinner/treasure-overlay-spinner.js
aleph_analytics-0.0.6 vendor/assets/javascripts/angular-spinner/treasure-overlay-spinner.js
aleph_analytics-0.0.5 vendor/assets/javascripts/angular-spinner/treasure-overlay-spinner.js
aleph_analytics-0.0.4 vendor/assets/javascripts/angular-spinner/treasure-overlay-spinner.js
aleph_analytics-0.0.3 vendor/assets/javascripts/angular-spinner/treasure-overlay-spinner.js
aleph_analytics-0.0.2 vendor/assets/javascripts/angular-spinner/treasure-overlay-spinner.js
aleph_analytics-0.0.1.alpha vendor/assets/javascripts/angular-spinner/treasure-overlay-spinner.js
aleph_analytics-0.0.0.alpha vendor/assets/javascripts/angular-spinner/treasure-overlay-spinner.js