Forked from spencerfdavis/upload_content_modal.js.coffee
Last active
August 29, 2015 14:01
-
-
Save cadwallion/f6b67ff9721161878b3a 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) => | |
@lesson.set | |
content_type: "Content::Video" | |
content_icon_class: "icon-video" | |
content_attributes: | |
url: data.url | |
filename: "test.mp4" | |
@lesson.save() | |
super | |
setDefaults: -> | |
@lesson = @options.lesson | |
@fileUploadTypes = @FILE_TYPES[@lesson.get('content_type')] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment