diff options
| author | Teddy Wing | 2013-11-10 10:53:52 -0500 | 
|---|---|---|
| committer | Teddy Wing | 2013-11-10 10:53:52 -0500 | 
| commit | 8c850747e64101035f8b4b48016f2b17714beea4 (patch) | |
| tree | d37cd7f7acf9462e79d380cc6dc051d7b0df1ac0 /assets/js/views/sample.js | |
| parent | b8489c7cb7fbabb1186197bd546a6800bb55d0bf (diff) | |
| download | clip-play-8c850747e64101035f8b4b48016f2b17714beea4.tar.bz2 | |
Remove sample progress bar on '-' button click
Diffstat (limited to 'assets/js/views/sample.js')
| -rw-r--r-- | assets/js/views/sample.js | 18 | 
1 files changed, 15 insertions, 3 deletions
| diff --git a/assets/js/views/sample.js b/assets/js/views/sample.js index c728e47..ede97be 100644 --- a/assets/js/views/sample.js +++ b/assets/js/views/sample.js @@ -11,7 +11,9 @@ ClipPlay.Views.Sample = Marionette.ItemView.extend({          this.$('.js-keyboard-key').val(this.model.get('key'));  	}, -    initialize: function(){ +    initialize: function(options){ +        this.collection = options.collection; +                  this.listenTo(this.model, 'change:key', this.key_bind);          this.key_bind();      }, @@ -81,6 +83,16 @@ ClipPlay.Views.Sample = Marionette.ItemView.extend({      },      remove_sample: function(){ -        console.log('removed sample'); -    } +        this.collection.remove(this.model); +    }, + +	close: function() { +		var that = this; +		this.$el.animate({ +			height: 0, +			opacity: 0 +		}, 500, function() { +			Marionette.View.prototype.close.call(that, arguments); +		}); +	}  }); | 
