Sha256: 131847d299b9996886266dd0b04cfc028698b19d089571b0348fc2ab8a1089e4

Contents?: true

Size: 967 Bytes

Versions: 67

Compression:

Stored size: 967 Bytes

Contents

pageflow.ChapterItemView = Backbone.Marionette.ItemView.extend({
  tagName: 'li',
  template: 'templates/chapter_item',

  ui: {
    title: '> a > .title',
    number: '> a > .number',
    pages: 'ul.pages'
  },

  modelEvents: {
    change: 'update'
  },

  onRender: function() {
    var collectionView = this.options.sortable ? pageflow.SortableCollectionView : pageflow.CollectionView;

    this.subview(new collectionView({
      el: this.ui.pages,
      collection: this.model.pages,
      itemViewConstructor: this.options.pageItemView || pageflow.NavigatablePageItemView,
      itemViewOptions: this.options.pageItemViewOptions,
      connectWith: 'ul.pages'
    }));

    this.update();
  },

  update: function() {
    this.ui.title.text(this.model.get('title') || I18n.t('pageflow.editor.views.chapter_item_view.unnamed'));
    this.ui.number.text(I18n.t('pageflow.editor.views.chapter_item_view.chapter') + ' ' + (this.model.get('position') + 1));
  }
});

Version data entries

67 entries across 67 versions & 1 rubygems

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