summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2013-11-09 20:40:27 -0500
committerTeddy Wing2013-11-09 20:40:27 -0500
commit7b72828cf7fc0583b4937d3279ce410f3346c09e (patch)
treeb92bda48e2d05b6e3a222505835ced72f993b3e4
parent73ebf518510691539cc691c2ae89aa12bbe9ee81 (diff)
parent836f1fc06c58d7d97e31387026eedc6902267fea (diff)
downloadclip-play-7b72828cf7fc0583b4937d3279ce410f3346c09e.tar.bz2
Merge branch 'initialize-drag-on-add'
-rw-r--r--assets/js/views/sample-editor.js20
-rw-r--r--assets/js/views/sample.js25
-rw-r--r--index.html18
3 files changed, 25 insertions, 38 deletions
diff --git a/assets/js/views/sample-editor.js b/assets/js/views/sample-editor.js
index bb06b01..74dc04d 100644
--- a/assets/js/views/sample-editor.js
+++ b/assets/js/views/sample-editor.js
@@ -2,25 +2,10 @@ ClipPlay.Views.SampleEditor = Marionette.CollectionView.extend({
itemView: ClipPlay.Views.Sample,
initialize: function() {
- this.initialize_clip_drag_handles();
this.initialize_player();
},
- initialize_clip_drag_handles: function() {
- var $clip_line = $('.js-clip-line');
-
- $clip_line.draggable({
- axis: 'x',
- handle: '.js-drag-handle',
- scroll: false,
- containment: $clip_line.parents('.progress-bar')
- });
-
- $clip_line.on('drag', this.on_clip_drag_stop);
- },
-
-
// this will soon be obsolete
initialize_player: function() {
this.player = new OP.Player($('#single-video-lets-see-if-we-can-get-this-to-work').get(0));
@@ -33,10 +18,5 @@ ClipPlay.Views.SampleEditor = Marionette.CollectionView.extend({
el: $('#add-sample'),
collection: this.collection
});
- },
-
-
- on_clip_drag_stop: function(e, ui) {
-
}
}); \ No newline at end of file
diff --git a/assets/js/views/sample.js b/assets/js/views/sample.js
index 96f42b7..9f57c06 100644
--- a/assets/js/views/sample.js
+++ b/assets/js/views/sample.js
@@ -1,3 +1,26 @@
ClipPlay.Views.Sample = Marionette.ItemView.extend({
- template: '#sample-view-template'
+ template: '#sample-view-template',
+
+ onRender: function() {
+ this.initialize_clip_drag_handles();
+ },
+
+
+ initialize_clip_drag_handles: function() {
+ var $clip_line = this.$('.js-clip-line');
+
+ $clip_line.draggable({
+ axis: 'x',
+ handle: '.js-drag-handle',
+ scroll: false,
+ containment: $clip_line.parents('.progress-bar')
+ });
+
+ $clip_line.on('dragstop', this.on_clip_drag_stop);
+ },
+
+
+ on_clip_drag_stop: function(e, ui) {
+ console.log('booyakacha');
+ }
}); \ No newline at end of file
diff --git a/index.html b/index.html
index bd2d1c2..5a09cef 100644
--- a/index.html
+++ b/index.html
@@ -22,23 +22,7 @@
</form>
</div>
- <div id="samples">
- <div class="edit-sample js-edit-sample">
- <div class="progress-bar">
- <div class="clip-line js-clip-line js-start-position">
- <div class="drag-handle js-drag-handle"></div>
- </div>
-
- <div class="clip-line js-clip-line js-end-position">
- <div class="drag-handle js-drag-handle"></div>
- </div>
- </div>
-
- <div>
- <input type="text" class="js-keyboard-key" placeholder="a" />
- </div>
- </div>
- </div>
+ <div id="samples"></div>
<div class="video">