Blame view

resources/js/common/directives/frLitelay.js 605 Bytes
e77200db5   nologostudio.ru   Initial commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  import '../jquery.litelay';
  
  angular.module('fr.litelay', [])
  
  .directive('frLitelay', function () {
      return {
          link: function (scope, element, attrs) {
              var last;
  
              scope.$watch(attrs.frLitelay, function (newValue) {
                  if (newValue === last) {
                      return;
                  }
  
                  last = newValue;
  
                  if (newValue) {
                      element.litelay({ off: false, spinner: true });
                  } else {
                      element.litelay({ off: true });
                  }
              });
          },
      };
  });