/**
 * Animated load block
 */
(function () {
  'use strict';

  angular.module('Monitour.theme')
      .directive('zoomIn', zoomIn);

  /** @ngInject */
  function zoomIn($timeout, $rootScope) {
    return {
      restrict: 'A',
      link: function ($scope, elem) {
        var delay = 500;

        if ($rootScope.$pageFinishedLoading) {
          delay = 10;
        }

        $timeout(function () {
          elem.removeClass('full-invisible');
          elem.addClass('animated fadeIn');
        }, delay);
      }
    };
  }

})();