<commit_before>angular.module('foundation.common.directives', []);

angular.module('foundation.common.directives')
  .directive('faClose', ['FoundationApi', function(foundationApi) {
  return {
    restrict: 'A',
    link: function(scope, element, attrs) {
      var parentElement= false;
      var tempElement = element.parent();

      //find parent modal
      while(parentElement == false) {
        if(tempElement[0].nodeName == 'BODY') {
          parentElement = '';
        }

        if(typeof tempElement.attr('fa-closable') !== 'undefined' && tempElement.attr('fa-closable') !== false) {
          parentElement = tempElement;
        }

        tempElement = tempElement.parent();
      }

      element.on('click', function(e) {
        foundationApi.publish(parentElement.attr('id'), 'close');
        e.preventDefault();
      });
    }
  }
}]);

angular.module('foundation.common.directives')
  .directive('faOpen', ['FoundationApi', function(foundationApi) {
  return {
    restrict: 'A',
    link: function(scope, element, attrs) {
      element.on('click', function(e) {
        foundationApi.publish(attrs.faOpen, 'open');
        e.preventDefault();
      });
    }
  }
}]);

angular.module('foundation.common.directives')
  .directive('faToggle', ['FoundationApi', function(foundationApi) {
  return {
    restrict: 'A',
    link: function(scope, element, attrs) {
      element.on('click', function(e) {
        foundationApi.publish(attrs.faToggle, 'toggle');
        e.preventDefault();
      });
    }
  }
}]);

angular.module('foundation.common.directives')
  .directive('faAnimationIn', ['FoundationApi', function(foundationApi) {
  return {
    restrict: 'A',
    link: function(scope, element, attrs) {
      //animation logic
    }
  };
}]);

angular.module('foundation.common.directives')
  .directive('faAnimationIn', ['FoundationApi', function(foundationApi) {
  return {
    restrict: 'A',
    link: function(scope, element, attrs) {
      //animation logic
    }
  };
}]);<commit_msg>Animation In prototype<commit_after>angular.module('foundation.common.directives', []);

angular.module('foundation.common.directives')
  .directive('faClose', ['FoundationApi', function(foundationApi) {
  return {
    restrict: 'A',
    link: function(scope, element, attrs) {
      var parentElement= false;
      var tempElement = element.parent();

      //find parent modal
      while(parentElement == false) {
        if(tempElement[0].nodeName == 'BODY') {
          parentElement = '';
        }

        if(typeof tempElement.attr('fa-closable') !== 'undefined' && tempElement.attr('fa-closable') !== false) {
          parentElement = tempElement;
        }

        tempElement = tempElement.parent();
      }

      element.on('click', function(e) {
        foundationApi.publish(parentElement.attr('id'), 'close');
        e.preventDefault();
      });
    }
  }
}]);

angular.module('foundation.common.directives')
  .directive('faOpen', ['FoundationApi', function(foundationApi) {
  return {
    restrict: 'A',
    link: function(scope, element, attrs) {
      element.on('click', function(e) {
        foundationApi.publish(attrs.faOpen, 'open');
        e.preventDefault();
      });
    }
  }
}]);

angular.module('foundation.common.directives')
  .directive('faToggle', ['FoundationApi', function(foundationApi) {
  return {
    restrict: 'A',
    link: function(scope, element, attrs) {
      element.on('click', function(e) {
        foundationApi.publish(attrs.faToggle, 'toggle');
        e.preventDefault();
      });
    }
  }
}]);

angular.module('foundation.common.directives')
  .directive('faAnimationIn', ['FoundationApi', function(foundationApi) {
  return {
    restrict: 'A',
    priority: 100, //set priority to override other directives
    link: function(scope, element, attrs) {
      var animation = attrs.faAnimationIn;
      var active = 'is-active';

      //subscribe
      foundationApi.subbscribe(attrs.id, function(msg) {
        //stop animation
        element[0].style.transitionDuration = 0;

        element.addClass(animation);

        //force a "tick"
        scope.$apply();

        //activate
        element[0].style.transitionDuration = '';
        element.addClass(active);


        element.one(events.join(' '), function() {
          //cleanup
          element.removeClass(animation);
        });

      });
    }
  };
}]);

angular.module('foundation.common.directives')
  .directive('faAnimationIn', ['FoundationApi', function(foundationApi) {
  return {
    restrict: 'A',
    priority: 100, //set priority to override other directives
    link: function(scope, element, attrs) {
      //animation logic
    }
  };
}]);
{'fraction_non_alphanumeric': 0.1600084997875053, 'fraction_numerical': 0.002337441563960901, 'mean_word_length': 2.9788672865595944, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '352359', 'n_tokens_mistral': 1390, 'n_tokens_neox': 1398, 'n_words': 237}