<commit_before>(function() {
  'use strict';

  angular.module('ui.gridstack', [])

  .controller('GridstackController', ['$scope', '$element', '$attrs',
      function($scope, $element, $attrs) {

        var gridstack = null;
        this.init = function(element, options) {
          gridstack = element.gridstack(options).data('gridstack');
          return gridstack;
        };

        this.removeItem = function(element){
          if (gridstack) {
            return gridstack.remove_widget(element, false);
          }
          return null;
        };

        this.addItem = function(element, x, y, width, height, auto) {
          if (gridstack) {
            return gridstack.add_widget(element, x, y, width, height, auto);
          }
          return null;
        };

  }])

  .directive("gridStack", [function () {
      return {
          restrict: "A",
          controller: 'GridstackController',
          scope: {
            dragStart: '&',
            dragStop: '&',
            resizeStart: '&',
            resizeStop: '&',
            serialize: '&',
            options: '='
          },
          link: function (scope, element, attrs, controller, ngModel) {

              controller.init(element, scope.options);

              element.on('change', function (e, items) {
                  scope.serialize();
              });
              
              element.on('dragstart', function(e, ui) {
                  scope.dragStart();
              });

              element.on('dragstop', function(e, ui) {
                  scope.dragStop();
              });

              element.on('resizestart', function(e, ui) {
                  scope.resizeStart(ui.element.children(':first').attr('id'));
              });

              element.on('resizestop', function(e, ui) {
                  scope.resizeStop();
              });
          }
      };
  }])

  .directive("gridstackItem", [function () {
      return {
          restrict: "A",
          controller: 'GridstackController',
          require: '^gridStack',
          scope: false,
          link: function (scope, element, attrs, controller) {
              attrs.$observe('gridstackItem', function(val) {
                var widget = controller.addItem(element, attrs.gsX, attrs.gsY, attrs.gsWidth, attrs.gsHeight, scope.$eval(attrs.gsAutoPosition));
              });
              element.bind('$destroy', function() {
                controller.removeItem(element);
              });
          }

      };
  }]);


})();
<commit_msg>fixed resize start to pass id<commit_after>(function() {
  'use strict';

  angular.module('ui.gridstack', [])

  .controller('GridstackController', ['$scope', '$element', '$attrs',
      function($scope, $element, $attrs) {

        var gridstack = null;
        this.init = function(element, options) {
          gridstack = element.gridstack(options).data('gridstack');
          return gridstack;
        };

        this.removeItem = function(element){
          if (gridstack) {
            return gridstack.remove_widget(element, false);
          }
          return null;
        };

        this.addItem = function(element, x, y, width, height, auto) {
          if (gridstack) {
            return gridstack.add_widget(element, x, y, width, height, auto);
          }
          return null;
        };

  }])

  .directive("gridStack", [function () {
      return {
          restrict: "A",
          controller: 'GridstackController',
          scope: {
            dragStart: '&',
            dragStop: '&',
            resizeStart: '&',
            resizeStop: '&',
            serialize: '&',
            options: '='
          },
          link: function (scope, element, attrs, controller, ngModel) {

              controller.init(element, scope.options);

              element.on('change', function (e, items) {
                  scope.serialize();
              });
              
              element.on('dragstart', function(e, ui) {
                  scope.dragStart();
              });

              element.on('dragstop', function(e, ui) {
                  scope.dragStop();
              });

              element.on('resizestart', function(e, ui) {
                  scope.resizeStart()(ui.element.children(':first').attr('id'));
              });

              element.on('resizestop', function(e, ui) {
                  scope.resizeStop();
              });
          }
      };
  }])

  .directive("gridstackItem", [function () {
      return {
          restrict: "A",
          controller: 'GridstackController',
          require: '^gridStack',
          scope: false,
          link: function (scope, element, attrs, controller) {
              attrs.$observe('gridstackItem', function(val) {
                var widget = controller.addItem(element, attrs.gsX, attrs.gsY, attrs.gsWidth, attrs.gsHeight, scope.$eval(attrs.gsAutoPosition));
              });
              element.bind('$destroy', function() {
                controller.removeItem(element);
              });
          }

      };
  }]);


})();

{'fraction_non_alphanumeric': 0.14426100628930819, 'fraction_numerical': 0.0, 'mean_word_length': 1.5990806945863125, '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': '4005178', 'n_tokens_mistral': 1372, 'n_tokens_neox': 1336, 'n_words': 249}