diff options
| author | Kawandeep Virdee | 2013-11-10 11:21:54 -0500 | 
|---|---|---|
| committer | Kawandeep Virdee | 2013-11-10 11:21:54 -0500 | 
| commit | c9a1791ffb8784156b52a19245761aabb62851f9 (patch) | |
| tree | 5a74ce73a71826e357f488cf2963f20a628ef716 /assets | |
| parent | d6dc09807926d9b1f8f5657b6c1e773d9978993d (diff) | |
| parent | ace843986a673e6736001997cd35ab9f65365268 (diff) | |
| download | clip-play-c9a1791ffb8784156b52a19245761aabb62851f9.tar.bz2 | |
Merge branch 'master' of github.com:whichlight/clip-play
Diffstat (limited to 'assets')
| -rw-r--r-- | assets/css/application.css | 4 | ||||
| -rw-r--r-- | assets/js/views/sample-editor.js | 5 | ||||
| -rw-r--r-- | assets/js/views/sample.js | 26 | 
3 files changed, 29 insertions, 6 deletions
diff --git a/assets/css/application.css b/assets/css/application.css index fa98475..215daca 100644 --- a/assets/css/application.css +++ b/assets/css/application.css @@ -168,8 +168,8 @@ header {  .button.red{ -	background-color: #887c7c; -	border-color: #887c7c; +	background-color: #882222; +	border-color: #882222;  	color: #eee;  	text-shadow: 0px 1px 2px rgba(0,0,0,0.9);      -webkit-box-shadow:  0px 4px 1px 0px rgba(92, 5, 5, 1); diff --git a/assets/js/views/sample-editor.js b/assets/js/views/sample-editor.js index 6accd89..088e588 100644 --- a/assets/js/views/sample-editor.js +++ b/assets/js/views/sample-editor.js @@ -1,5 +1,10 @@  ClipPlay.Views.SampleEditor = Marionette.CollectionView.extend({  	itemView: ClipPlay.Views.Sample, +	itemViewOptions: function(model, index) { +		return { +			collection: this.collection +		}; +	},  	onRender: function() {  		// Initialize view for adding new samples diff --git a/assets/js/views/sample.js b/assets/js/views/sample.js index c1462f6..210975e 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();      }, @@ -26,7 +28,8 @@ ClipPlay.Views.Sample = Marionette.ItemView.extend({  			var schema = data.provider_name.toLowerCase();  			var iframe_src= BASE_IFRAME +"?schema="+schema+"&type=text%2Fhtml&html="+src;  			var iframe = $('<iframe/>', { -				src: iframe_src +				src: iframe_src, +				id: 'video-sample-' + that.model.cid  			});              var wrapper= document.createElement('div');              $(wrapper).addClass("responsive-object"); @@ -84,6 +87,21 @@ ClipPlay.Views.Sample = Marionette.ItemView.extend({      },      remove_sample: function(){ -        console.log('removed sample'); -    } +        this.collection.remove(this.model); +         +        var $iframe_video = $('#video-sample-' + this.model.cid); +        $iframe_video.fadeOut(400, function() { +        	$iframe_video.remove(); +        }); +    }, + +	close: function() { +		var that = this; +		this.$el.animate({ +			height: 0, +			opacity: 0 +		}, 500, function() { +			Marionette.View.prototype.close.call(that, arguments); +		}); +	}  });  | 
