diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-11-14 17:08:53 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-11-14 17:08:53 -0500 |
| commit | 5b9b94d0dac5ddb70a5ea51b948cde40ae898202 (patch) | |
| tree | 53fdca79e002613d6bd845fd14b32fe06a27bf36 /public/assets/javascripts/ui/editor/MediaEditor.js | |
| parent | d729d5f58fa4a4a30e252ab063bcf636559945b0 (diff) | |
fix click/bind behavior
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() |
