diff options
| author | Kawandeep Virdee | 2013-11-10 12:43:02 -0500 | 
|---|---|---|
| committer | Kawandeep Virdee | 2013-11-10 12:43:02 -0500 | 
| commit | 2d6422265f55905cb83b56ce4dfa2090f5dfe62e (patch) | |
| tree | ba10313154ba9820b07eadf473af3f62e4090dd1 /assets/js/views/sample.js | |
| parent | 6450eea1310266129416a256cdff1f3f5d7f137c (diff) | |
| parent | 2c4c8d1f538d33a37bf4091282a454da74465b06 (diff) | |
| download | clip-play-2d6422265f55905cb83b56ce4dfa2090f5dfe62e.tar.bz2 | |
Merge branch 'master' of github.com:whichlight/clip-play
Diffstat (limited to 'assets/js/views/sample.js')
| -rw-r--r-- | assets/js/views/sample.js | 17 | 
1 files changed, 11 insertions, 6 deletions
diff --git a/assets/js/views/sample.js b/assets/js/views/sample.js index 21e0806..6d1f95a 100644 --- a/assets/js/views/sample.js +++ b/assets/js/views/sample.js @@ -5,19 +5,20 @@ ClipPlay.Views.Sample = Marionette.ItemView.extend({          'click .js-remove-sample' : 'remove_sample'  	}, -	onRender: function() { -		this.initialize_player(); -		this.initialize_clip_lines(); -        this.$('.js-keyboard-key').val(this.model.get('key')); -	}, -      initialize: function(options){          this.collection = options.collection;          this.listenTo(this.model, 'change:key', this.key_bind);          this.listenTo(this.model, 'change:playing', this.show_clip);          this.key_bind(); +        this.listenTo(this.model, 'change:thumbnail', this.render_thumbnail);      }, +	onRender: function() { +		this.initialize_player(); +		this.initialize_clip_lines(); +        this.$('.js-keyboard-key').val(this.model.get('key')); +	}, +  	initialize_player: function() {  		var that = this;  		$.embedly.oembed(this.model.get('url')).done(function(results){ @@ -76,6 +77,10 @@ ClipPlay.Views.Sample = Marionette.ItemView.extend({  		});  	}, +	render_thumbnail: function() { +		this.$('.js-thumbnail').html('<img src="' + this.model.get('thumbnail') + '" alt="thumbnail" class="thumbnail-image" />'); +	}, +      on_keyboard_change: function(){        var keyval = this.$('.js-keyboard-key').val();        if (keyval != this.model.get('key')){  | 
