Stop playing on mix change

This commit is contained in:
Fergal Moran
2013-06-17 21:07:24 +01:00
parent ab937dbedd
commit 838b46c054
2 changed files with 7 additions and 5 deletions

View File

@@ -24,11 +24,10 @@ define ['marionette', 'vent', 'models/mix/mixCollection', 'views/mix/mixItemView
mixPlay: (model) ->
console.log "MixListView: mixPlay"
"""
if currentMix != -1
v = @children.findByModelCid(currentMix)
v.mixPause()
"""
v.mixPause(v.model)
currentMix = model.cid
return

View File

@@ -42,9 +42,12 @@
};
MixListView.prototype.mixPlay = function(model) {
var v;
console.log("MixListView: mixPlay");
"if currentMix != -1\n v = @children.findByModelCid(currentMix)\n v.mixPause()";
if (currentMix !== -1) {
v = this.children.findByModelCid(currentMix);
v.mixPause(v.model);
}
currentMix = model.cid;
};