summaryrefslogtreecommitdiffstats
path: root/assets/js/views/sample-editor.js
blob: bb06b013154308289a1235608fdaabb0a5d775c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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));
	},
	
	
	onRender: function() {
		// Initialize view for adding new samples
		this.sample_add_view = new ClipPlay.Views.SampleAddView({
			el: $('#add-sample'),
			collection: this.collection
		});
	},
	
	
	on_clip_drag_stop: function(e, ui) {
		
	}
});