<commit_before>angular.module('ngDrag').directive('ngDrag', function (DragData) {
  /**
   * @ngdoc directive
   * @name ngDrag.directive:ngDrag
   * @description A directive that allows an item to be dragged and its $scope
   * tracked and provided to the drop target upon drop.
   * @param {String} ngDrag Either emtpy or a string that can be used to
   * identify the type of data that is being transferred. This is most useful
   * for limiting where an item can be dropped. For example, say you show
   * multiple items each with multiple steps, and you want to limit dragging
   * steps to the same item.
   *
   * ```html
   * <div class="item" ng-drag="item/{{item.id}}">...</div>
   * ```
   *
   * @param {Expression} dragStart An expression that will be executed on
   * dragstart. Event available as `$event`.
   * @param {Expression} dragEnd An expression that will be evaluated on
   * dragend. Event available as `$event`.
   * @restrict A
   */
  return {
    restrict: 'A',
    link: function postLink($scope, element, iAttrs) {
      element.attr('draggable', 'true');

      if (iAttrs.dragEnd) {
        element.on('dragend', function(e) {
          $scope.$apply(function() {
            $scope.$eval(iAttrs.dragEnd, {$event: e});
          });
        });
      }

      element.on('dragstart', function(e) {
        //Only add data if not already added (would be less specific)
        if ( !e.originalEvent.dataTransfer.getData('ngdrag/type') ) {
          e.originalEvent.dataTransfer.setData('ngdrag/type', iAttrs.ngDrag || 'ngdrag/id');
          e.originalEvent.dataTransfer.setData(iAttrs.ngDrag || 'ngdrag/id', $scope.$id);
        }
        DragData.add($scope);

        if (iAttrs.dragStart) {
          $scope.$apply(function() {
            $scope.$eval(iAttrs.dragStart, {$event: e});
          });
        }
      });<commit_msg>Attempt to fix chrome dragstart DOM manipulation bug<commit_after>angular.module('ngDrag').directive('ngDrag', function (DragData) {
  /**
   * @ngdoc directive
   * @name ngDrag.directive:ngDrag
   * @description A directive that allows an item to be dragged and its $scope
   * tracked and provided to the drop target upon drop.
   * @param {String} ngDrag Either emtpy or a string that can be used to
   * identify the type of data that is being transferred. This is most useful
   * for limiting where an item can be dropped. For example, say you show
   * multiple items each with multiple steps, and you want to limit dragging
   * steps to the same item.
   *
   * ```html
   * <div class="item" ng-drag="item/{{item.id}}">...</div>
   * ```
   *
   * @param {Expression} dragStart An expression that will be executed on
   * dragstart. Event available as `$event`.
   * @param {Expression} dragEnd An expression that will be evaluated on
   * dragend. Event available as `$event`.
   * @restrict A
   */
  return {
    restrict: 'A',
    link: function postLink($scope, element, iAttrs) {
      element.attr('draggable', 'true');

      if (iAttrs.dragEnd) {
        element.on('dragend', function(e) {
          $timeout(function() {
            $scope.$eval(iAttrs.dragEnd, {$event: e});
          });
        });
      }

      element.on('dragstart', function(e) {
        //Only add data if not already added (would be less specific)
        if ( !e.originalEvent.dataTransfer.getData('ngdrag/type') ) {
          e.originalEvent.dataTransfer.setData('ngdrag/type', iAttrs.ngDrag || 'ngdrag/id');
          e.originalEvent.dataTransfer.setData(iAttrs.ngDrag || 'ngdrag/id', $scope.$id);
        }
        DragData.add($scope);

        if (iAttrs.dragStart) {
          $timeout(function() {
            $scope.$eval(iAttrs.dragStart, {$event: e});
          });
        }
      });
{'fraction_non_alphanumeric': 0.13187981919702207, 'fraction_numerical': 0.0, 'mean_word_length': 2.652427184466019, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6406136', 'n_tokens_mistral': 1130, 'n_tokens_neox': 1120, 'n_words': 341}