Sha256: cd532fcb352e4934e93dc516cd45715fbd2e71e8745783c9d7a08f4f25272727

Contents?: true

Size: 864 Bytes

Versions: 2

Compression:

Stored size: 864 Bytes

Contents

pageflow.externalLinks.SiteReferenceItemView = Backbone.Marionette.ItemView.extend({
  template: 'pageflow/external_links/editor/templates/site_reference_item',

  tagName: 'li',
  className: 'external_links_site_reference',

  ui: {
    thumbnail: '.thumbnail',
    title: '.title'
  },

  events: {
    'click .remove': function() {
      this.model.destroy();
      return false;
    },

    'click .edit': function() {
      pageflow.editor.navigate('/external_links/sites/' + this.model.get('site').id + '/?page=' + this.options.page.id + '&return_to=page', {trigger: true});
      return false;
    }
  },

  onRender: function() {
    this.subview(new pageflow.FileThumbnailView({
      el: this.ui.thumbnail,
      model: this.model.get('site').getThumbnail()
    }));

    this.ui.title.text(this.model.get('site').get('title') || '(Unbenannt)');
  },
});

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pageflow-external-links-0.1.0 app/assets/javascript/pageflow/external_links/editor/views/site_reference_item_view.js
pageflow-external-links-0.0.1 app/assets/javascript/pageflow/external_links/editor/views/site_reference_item_view.js