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