Sha256: a75e924eb71d036d915dc1b5b94856a6631b9e962a8ac55df4e581b8f39bf115
Contents?: true
Size: 1.02 KB
Versions: 18
Compression:
Stored size: 1.02 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.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
18 entries across 18 versions & 1 rubygems