summaryrefslogtreecommitdiffstats
path: root/assets
diff options
context:
space:
mode:
authorTeddy Wing2013-11-10 03:54:26 -0500
committerTeddy Wing2013-11-10 03:54:26 -0500
commitce934abac93b110cbc4ab0bddeb562f5b77c223d (patch)
tree8ce9783d22be875d3575e0fd57f2cb67fa28b51a /assets
parent9d4af82f9616aa2dc9534dc989f04d1002b5cf34 (diff)
downloadclip-play-ce934abac93b110cbc4ab0bddeb562f5b77c223d.tar.bz2
Play video on click of SelectedBar
Diffstat (limited to 'assets')
-rw-r--r--assets/js/views/sample.js1
-rw-r--r--assets/js/views/selected-bar.js10
2 files changed, 11 insertions, 0 deletions
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,