From ce934abac93b110cbc4ab0bddeb562f5b77c223d Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 10 Nov 2013 03:54:26 -0500 Subject: Play video on click of SelectedBar --- assets/js/views/sample.js | 1 + assets/js/views/selected-bar.js | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/assets/js/views/sample.js b/assets/js/views/sample.js index bab5488..6a56ae7 100644 --- a/assets/js/views/sample.js +++ b/assets/js/views/sample.js @@ -56,6 +56,7 @@ ClipPlay.Views.Sample = Marionette.ItemView.extend({ this.selected_bar = new ClipPlay.Views.SelectedBar({ el: this.$('.js-selected-bar'), + model: this.model, sample_view: this }); }, diff --git a/assets/js/views/selected-bar.js b/assets/js/views/selected-bar.js index 91727b6..b9cf47d 100644 --- a/assets/js/views/selected-bar.js +++ b/assets/js/views/selected-bar.js @@ -1,4 +1,9 @@ ClipPlay.Views.SelectedBar = Marionette.View.extend({ + events: { + 'click': 'play' + }, + + initialize: function(options) { this.setElement(options.el); this.sample_view = options.sample_view; @@ -35,6 +40,11 @@ ClipPlay.Views.SelectedBar = Marionette.View.extend({ }, + play: function() { + this.model.play(); + }, + + on_selected_bar_drag: function() { this.sample_view.trigger('change:position:selected-bar', { position: this.$el.position().left, -- cgit v1.2.3