Sha256: 41d8d7eb03c745dbe9f3cbc926de691df215329f5590de3e190b36730f3bfcb9
Contents?: true
Size: 954 Bytes
Versions: 3
Compression:
Stored size: 954 Bytes
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.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.destroyUsage(); } }, updateSelection: function() { if (this.ui.checkBox.is(':checked')) { this.options.selectedFiles.add(this.model); } else { this.options.selectedFiles.remove(this.model); } }, });
Version data entries
3 entries across 3 versions & 1 rubygems