diff options
| author | Teddy Wing | 2013-11-10 11:51:10 -0500 | 
|---|---|---|
| committer | Teddy Wing | 2013-11-10 11:51:10 -0500 | 
| commit | d907e2edc62ea2b990c722b9db0af73aecebaa74 (patch) | |
| tree | 1fe61e5c1e3f60b7c2912887c115d7f0a8874d6f /assets/js/views/sample.js | |
| parent | 4376526f8bc7e72e3d7cc958a97ade1104dc88d6 (diff) | |
| parent | 87c690f48ba179a4822a99e51f52baafccc83fad (diff) | |
| download | clip-play-d907e2edc62ea2b990c722b9db0af73aecebaa74.tar.bz2 | |
Merge branch 'add-thumbnail-to-sample'
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 aa07acd..3122641 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.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){ @@ -77,6 +78,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')){  | 
