diff options
Diffstat (limited to 'public/assets/javascripts/ui/editor/MediaEditor.js')
| -rw-r--r-- | public/assets/javascripts/ui/editor/MediaEditor.js | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/public/assets/javascripts/ui/editor/MediaEditor.js b/public/assets/javascripts/ui/editor/MediaEditor.js index de93f6e..21759d6 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() } @@ -74,15 +74,17 @@ var MediaEditor = FormView.extend({ 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() |
