summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/ui/editor/MediaEditor.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/assets/javascripts/ui/editor/MediaEditor.js')
-rw-r--r--public/assets/javascripts/ui/editor/MediaEditor.js20
1 files changed, 16 insertions, 4 deletions
diff --git a/public/assets/javascripts/ui/editor/MediaEditor.js b/public/assets/javascripts/ui/editor/MediaEditor.js
index de93f6e..6068c48 100644
--- a/public/assets/javascripts/ui/editor/MediaEditor.js
+++ b/public/assets/javascripts/ui/editor/MediaEditor.js
@@ -51,7 +51,7 @@ var MediaEditor = FormView.extend({
},
pick: function(scenery) {
- if (this.scenery) {
+ if (this.scenery && scenery !== this.scenery) {
this.unbind()
}
@@ -67,22 +67,24 @@ var MediaEditor = FormView.extend({
// console.log(media)
- this.$name.val(media.title || filenameFromUrl(media.url) )
+ this.$name.val(media.title) // || filenameFromUrl(media.url) )
this.$description.val(media.description)
this.setDimensions()
this.$units.val( "ft" )
switch (media.type) {
case "image":
- this.$(".image").show()
this.$(".video").hide()
+ this.$(".audio").hide()
+ this.$(".image").show()
break
case "youtube":
case "vimeo":
case "video":
- this.$(".video").show()
this.$(".image").hide()
+ this.$(".audio").hide()
+ this.$(".video").show()
this.$playButton.toggleClass("paused", ! this.scenery.paused())
this.$autoplay.prop('checked', !! media.autoplay)
@@ -90,6 +92,15 @@ var MediaEditor = FormView.extend({
this.$mute.prop('checked', !! media.mute)
this.$keyframe.val( Number(media.keyframe || 0) )
break
+
+ case "soundcloud":
+ this.$(".image").hide()
+ this.$(".video").hide()
+ this.$(".audio").show()
+ this.$playButton.toggleClass("paused", ! this.scenery.paused())
+ this.$autoplay.prop('checked', !! media.autoplay)
+ this.$loop.prop('checked', !! media.loop)
+ break
}
},
@@ -161,6 +172,7 @@ var MediaEditor = FormView.extend({
unbind: function(){
if (this.scenery) {
+ this.scenery.focused = false
if (this.tainted && this.scenery.media) {
this.scenery.media.title = this.$name.val()
this.scenery.media.description = this.$description.val()