<commit_before>pageflow.SortableCollectionView = pageflow.CollectionView.extend({
  render: function() {
    pageflow.CollectionView.prototype.render.call(this);

    this.$el.sortable({
      connectWith: this.options.connectWith,
      placeholder: 'sortable-placeholder',
      forcePlaceholderSize: true,
      delay: 200,

      update: _.bind(function(event, ui) {
        if (ui.item.parent().is(this.el)) {
          this.updateOrder();
        }
      }, this),

      receive: _.bind(function(event, ui) {
        var view = ui.item.data('view');

        this.updateOrder();

        this.itemViews.add(view);
        this.collection.add(view.model);
      }, this),

      remove: _.bind(function(event, ui) {
        var view = ui.item.data('view');

        this.itemViews.remove(view);
        this.collection.remove(view.model);
      }, this)
    });

    return this;
  },

  addItem: function(item) {
    if (!this.itemViews.findByModel(item)) {
      pageflow.CollectionView.prototype.addItem.call(this, item);
    }
  },

  removeItem: function(item) {
    if (this.itemViews.findByModel(item)) {
      pageflow.CollectionView.prototype.removeItem.call(this, item);
    }<commit_msg>do not save order on receive<commit_after>pageflow.SortableCollectionView = pageflow.CollectionView.extend({
  render: function() {
    pageflow.CollectionView.prototype.render.call(this);

    this.$el.sortable({
      connectWith: this.options.connectWith,
      placeholder: 'sortable-placeholder',
      forcePlaceholderSize: true,
      delay: 200,

      update: _.bind(function(event, ui) {
        if (ui.item.parent().is(this.el)) {
          this.updateOrder();
        }
      }, this),

      receive: _.bind(function(event, ui) {
        var view = ui.item.data('view');

        this.itemViews.add(view);
        this.collection.add(view.model);
      }, this),

      remove: _.bind(function(event, ui) {
        var view = ui.item.data('view');

        this.itemViews.remove(view);
        this.collection.remove(view.model);
      }, this)
    });

    return this;
  },

  addItem: function(item) {
    if (!this.itemViews.findByModel(item)) {
      pageflow.CollectionView.prototype.addItem.call(this, item);
    }
  },

  removeItem: function(item) {
    if (this.itemViews.findByModel(item)) {
      pageflow.CollectionView.prototype.removeItem.call(this, item);
    }
{'fraction_non_alphanumeric': 0.14619883040935672, 'fraction_numerical': 0.002506265664160401, 'mean_word_length': 2.690292758089368, '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': '6745334', 'n_tokens_mistral': 756, 'n_tokens_neox': 729, 'n_words': 112}