Sha256: 6acee9217ffccaeb4a6687e16a3016b0c38254d872ac80da0ef35c2a0e811859

Contents?: true

Size: 1.01 KB

Versions: 58

Compression:

Stored size: 1.01 KB

Contents

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

  ui: {
    fileName: '.file_name',
    duration: '.duration',

    label: 'label',
    checkBox: 'input',
    removeButton: '.remove',
  },

  events: {
    'click .remove': 'destroy',

    'change input': 'updateSelection'
  },

  onRender: function() {
    this.ui.label.attr('for', this.cid);
    this.ui.checkBox.attr('id', this.cid);
    this.ui.checkBox.prop('checked', this.options.selectedFiles.contains(this.model));

    this.ui.fileName.text(this.model.get('file_name') || '(Unbekannt)');
    this.ui.duration.text(this.model.get('duration') || '-');
  },

  destroy: function() {
    if (confirm("Datei wirklich wirklich löschen?")) {
      this.model.destroy();
    }
  },

  updateSelection: function() {
    if (this.ui.checkBox.is(':checked')) {
      this.options.selectedFiles.add(this.model);
    }
    else {
      this.options.selectedFiles.remove(this.model);
    }
  },
});

Version data entries

58 entries across 58 versions & 1 rubygems

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