Sha256: 98195c7d5b12e28f037bacf9fd2ecb57d79bf988030b9f2acce85f126b5fc35f

Contents?: true

Size: 788 Bytes

Versions: 64

Compression:

Stored size: 788 Bytes

Contents

pageflow.StorylinesCollection = Backbone.Collection.extend({
  autoConsolidatePositions: false,

  mixins: [pageflow.orderedCollection],

  model: pageflow.Storyline,

  url: function() {
    return '/entries/' + pageflow.entry.get('id') + '/storylines';
  },

  initialize: function() {
    this.listenTo(this, 'change:main', function(model, value) {
      if (value) {
        this.each(function(storyline) {
          if (storyline.isMain() && storyline !== model) {
            storyline.configuration.unset('main');
          }
        });
      }
    });
  },

  main: function() {
    return this.find(function(storyline) {
      return storyline.configuration.get('main');
    }) || this.first();
  },

  comparator: function(chapter) {
    return chapter.get('position');
  }
});

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
pageflow-14.5.2 app/assets/javascripts/pageflow/editor/collections/storylines_collection.js
pageflow-15.0.2 app/assets/javascripts/pageflow/editor/collections/storylines_collection.js
pageflow-15.0.1 app/assets/javascripts/pageflow/editor/collections/storylines_collection.js
pageflow-15.0.0 app/assets/javascripts/pageflow/editor/collections/storylines_collection.js
pageflow-14.5.1 app/assets/javascripts/pageflow/editor/collections/storylines_collection.js
pageflow-14.5.0 app/assets/javascripts/pageflow/editor/collections/storylines_collection.js
pageflow-15.0.0.rc2 app/assets/javascripts/pageflow/editor/collections/storylines_collection.js
pageflow-15.0.0.rc1 app/assets/javascripts/pageflow/editor/collections/storylines_collection.js
pageflow-15.0.0.beta4 app/assets/javascripts/pageflow/editor/collections/storylines_collection.js
pageflow-15.0.0.beta3 app/assets/javascripts/pageflow/editor/collections/storylines_collection.js
pageflow-14.4.0 app/assets/javascripts/pageflow/editor/collections/storylines_collection.js
pageflow-15.0.0.beta2 app/assets/javascripts/pageflow/editor/collections/storylines_collection.js
pageflow-15.0.0.beta1 app/assets/javascripts/pageflow/editor/collections/storylines_collection.js
pageflow-14.3.0 app/assets/javascripts/pageflow/editor/collections/storylines_collection.js
pageflow-14.2.1 app/assets/javascripts/pageflow/editor/collections/storylines_collection.js
pageflow-14.2.0 app/assets/javascripts/pageflow/editor/collections/storylines_collection.js
pageflow-14.1.1 app/assets/javascripts/pageflow/editor/collections/storylines_collection.js
pageflow-14.1.0 app/assets/javascripts/pageflow/editor/collections/storylines_collection.js
pageflow-14.0.0 app/assets/javascripts/pageflow/editor/collections/storylines_collection.js
pageflow-14.0.0.rc2 app/assets/javascripts/pageflow/editor/collections/storylines_collection.js