Sha256: eb333d05349c9212bc7eca58b988337b5f8741280ea9000b667fd301b50eb7a7

Contents?: true

Size: 986 Bytes

Versions: 75

Compression:

Stored size: 986 Bytes

Contents

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

  mixins: [pageflow.loadable, pageflow.selectableView],

  selectionAttribute: 'file',

  ui: {
    fileName: '.file_name',

    thumbnail: '.file_thumbnail'
  },

  events: {
    'click': function() {
      if (!this.$el.hasClass('disabled')) {
        this.select();
      }
    }
  },

  modelEvents: {
    'change': 'update'
  },

  onRender: function() {
    this.update();

    this.subview(new pageflow.FileThumbnailView({
      el: this.ui.thumbnail,
      model: this.model
    }));
  },

  update: function() {
    if (this.isDisabled()) {
      this.$el.addClass('disabled');
    }

    this.$el.attr('data-id', this.model.id);
    this.ui.fileName.text(this.model.get('file_name') || '(Unbekannt)');
  },

  isDisabled: function() {
    return (this.options.disabledIds && _.contains(this.options.disabledIds, this.model.get('id')));
  }
});

Version data entries

75 entries across 75 versions & 1 rubygems

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