Sha256: b3b4361eba98ee6ae214b7c8b6582bd1ee1c91e56e0e479f7d562685fdfc1773
Contents?: true
Size: 1.35 KB
Versions: 6
Compression:
Stored size: 1.35 KB
Contents
pageflow.PageItemView = Backbone.Marionette.ItemView.extend({ tagName: 'li', template: 'templates/page_item', ui: { title: '.title', pictogram: '.type_pictogram', pageThumbnail: '.page_thumbnail' }, modelEvents: { 'change:title': 'update', 'change:active': 'update' }, onRender: function() { this.subview(new pageflow.PageThumbnailView({ el: this.ui.pageThumbnail, model: this.model })); this.update(); }, update: function() { this.$el.attr('data-id', this.model.id); this.$el.attr('data-perma-id', this.model.get('perma_id')); this.$el.toggleClass('active', this.model.get('active')); this.$el.toggleClass('display_in_navigation', !!this.model.configuration.get('display_in_navigation')); this.$el .removeClass(_.pluck(pageflow.Page.types, 'name').join(' ')) .addClass(this.model.get('template')); this.ui.pictogram.attr('title', this._getPictogramTitle()); this.ui.title.text(this.model.title() || I18n.t('pageflow.editor.views.page_item_view.unnamed')); }, _getPictogramTitle: function() { var result = I18n.t(this.model.pageType().translation_key); result += ' Seite'; if (this.options.displayInNavigationHint && !this.model.configuration.get('display_in_navigation')) { result += ' (nicht in Navigationsleiste)'; } return result; } });
Version data entries
6 entries across 6 versions & 1 rubygems