Created
May 15, 2014 18:23
-
-
Save spencerfdavis/941a4b9444ac0075c61c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require ['media-uploader'], (MediaUploader) -> | |
class Rise.Views.Teach.Lessons.UploadContentModal extends MediaUploader.UploadModal | |
el: '#upload-modal' | |
FILE_TYPES: | |
'Content::Document': ['pdf'] | |
'Content::Media': ['video', 'audio'] | |
initialize: -> | |
setDefaults() | |
super | |
onFileUploaded: (data) => | |
@model.set | |
content_type: "Content::Video" | |
content_icon_class: "icon-video" | |
content_attributes: | |
url: data.url | |
filename: "test.mp4" | |
@model.save() | |
super | |
setDefaults: -> | |
@options.fileUploadTypes = @FILE_TYPES[@model.get('content_type')] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment