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