From 07a2d8bd152fc1433fa7b5fc81b9fa36e7095e63 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 10 Nov 2013 11:24:11 -0500 Subject: Move initialize above onRender method --- assets/js/views/sample.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/assets/js/views/sample.js b/assets/js/views/sample.js index aa07acd..de9e967 100644 --- a/assets/js/views/sample.js +++ b/assets/js/views/sample.js @@ -5,12 +5,6 @@ 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; @@ -18,6 +12,12 @@ ClipPlay.Views.Sample = Marionette.ItemView.extend({ this.key_bind(); }, + 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){ -- cgit v1.2.3 From b5a05962d07325d31f37bedc38cc309980f91da7 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 10 Nov 2013 11:40:59 -0500 Subject: Add thumbnail to sample editor --- assets/css/sample-editor.css | 9 ++++++++- assets/js/views/sample.js | 5 +++++ index.html | 2 ++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/assets/css/sample-editor.css b/assets/css/sample-editor.css index 20ebd90..d905fb1 100644 --- a/assets/css/sample-editor.css +++ b/assets/css/sample-editor.css @@ -13,7 +13,7 @@ .progress-bar { border: 1px solid #b9b9b9; - width: 90%; + width: 80%; height: 3em; position: relative; background-color: #ddd; @@ -102,3 +102,10 @@ .edit-sample .key-input { margin-top: 0.1em; } + + +/* Thumbnail */ +.thumbnail-image { + height: 3em; + vertical-align: middle; +} diff --git a/assets/js/views/sample.js b/assets/js/views/sample.js index de9e967..3122641 100644 --- a/assets/js/views/sample.js +++ b/assets/js/views/sample.js @@ -10,6 +10,7 @@ ClipPlay.Views.Sample = Marionette.ItemView.extend({ this.listenTo(this.model, 'change:key', this.key_bind); this.key_bind(); + this.listenTo(this.model, 'change:thumbnail', this.render_thumbnail); }, onRender: function() { @@ -77,6 +78,10 @@ ClipPlay.Views.Sample = Marionette.ItemView.extend({ }); }, + render_thumbnail: function() { + this.$('.js-thumbnail').html('thumbnail'); + }, + on_keyboard_change: function(){ var keyval = this.$('.js-keyboard-key').val(); if (keyval != this.model.get('key')){ diff --git a/index.html b/index.html index 27d6463..4d76559 100644 --- a/index.html +++ b/index.html @@ -43,6 +43,8 @@