Download:
child 143:2afd675fcaa4
parent 141:c3a4224b195a
142:d702edce24b7
Anton Shestakov <av6@dwimlabs.net>, Tue, 12 Apr 2016 13:28:14 +0800
calls: make CallView listen to remove event

3 файлов изменено, 6 вставок(+), 12 удалений(-) [+]
coffee/calls.coffee file | annotate | diff | comparison | revisions
js/calls.js file | annotate | diff | comparison | revisions
js/calls.js.map file | annotate | diff | comparison | revisions
--- a/coffee/calls.coffee Mon Apr 11 22:21:49 2016 +0800
+++ b/coffee/calls.coffee Tue Apr 12 13:28:14 2016 +0800
@@ -53,6 +53,8 @@
@listenTo(@model, 'change:local/audio/muted', @muteMic)
@listenTo(@model, 'change:remote/audio/muted', @muteAudio)
+ @listenTo(@model, 'remove', @remove)
+
updateLocal: ->
if @model.has('local/stream/url')
@updateVideo(@$local, @model.get('local/stream/url'))
@@ -104,11 +106,7 @@
class Tram.CallsApp extends Backbone.View
initialize: ->
@listenTo(@collection, 'add', @onAdd)
- @listenTo(@collection, 'remove', @onRemove)
onAdd: (model) ->
model.view = new Tram.CallView(model: model)
@$el.append model.view.render().el
-
- onRemove: (model) ->
- model.view.remove()
--- a/js/calls.js Mon Apr 11 22:21:49 2016 +0800
+++ b/js/calls.js Tue Apr 12 13:28:14 2016 +0800
@@ -101,7 +101,8 @@
this.listenTo(this.model, 'change:remote/stream/url', this.updateRemote);
this.listenTo(this.model, 'change:local/video/muted', this.muteCam);
this.listenTo(this.model, 'change:local/audio/muted', this.muteMic);
- return this.listenTo(this.model, 'change:remote/audio/muted', this.muteAudio);
+ this.listenTo(this.model, 'change:remote/audio/muted', this.muteAudio);
+ return this.listenTo(this.model, 'remove', this.remove);
};
CallView.prototype.updateLocal = function() {
@@ -189,8 +190,7 @@
}
CallsApp.prototype.initialize = function() {
- this.listenTo(this.collection, 'add', this.onAdd);
- return this.listenTo(this.collection, 'remove', this.onRemove);
+ return this.listenTo(this.collection, 'add', this.onAdd);
};
CallsApp.prototype.onAdd = function(model) {
@@ -200,10 +200,6 @@
return this.$el.append(model.view.render().el);
};
- CallsApp.prototype.onRemove = function(model) {
- return model.view.remove();
- };
-
return CallsApp;
})(Backbone.View);
--- a/js/calls.js.map Mon Apr 11 22:21:49 2016 +0800
+++ b/js/calls.js.map Tue Apr 12 13:28:14 2016 +0800
@@ -6,5 +6,5 @@
"coffee/calls.coffee"
],
"names": [],
- "mappings": ";AAAA;AAAA,MAAA;;;EAAM,IAAI,CAAC;;;;;;;mBACT,WAAA,GAAa;;mBAEb,UAAA,GAAY,SAAA;MACV,IAAC,CAAA,EAAD,CAAI,qBAAJ,EAA2B,IAAC,CAAA,oBAA5B;aACA,IAAC,CAAA,EAAD,CAAI,sBAAJ,EAA4B,IAAC,CAAA,qBAA7B;IAFU;;mBAIZ,eAAA,GAAiB,SAAC,KAAD,EAAQ,KAAR;AACf,UAAA;MAAA,IAAG,IAAC,CAAA,GAAD,CAAK,KAAL,CAAH;QACE,GAAG,CAAC,eAAJ,CAAoB,IAAC,CAAA,GAAD,CAAK,KAAL,CAApB,EADF;;MAEA,MAAA,GAAS,IAAC,CAAA,GAAD,CAAK,KAAL;MACT,IAAG,MAAH;eACE,IAAC,CAAA,GAAD,CAAK,KAAL,EAAY,GAAG,CAAC,eAAJ,CAAoB,MAApB,CAAZ,EADF;OAAA,MAAA;eAGE,IAAC,CAAA,KAAD,CAAO,KAAP,EAHF;;IAJe;;mBASjB,oBAAA,GAAsB,SAAA;aACpB,IAAC,CAAA,eAAD,CAAiB,cAAjB,EAAiC,kBAAjC;IADoB;;mBAGtB,qBAAA,GAAuB,SAAA;aACrB,IAAC,CAAA,eAAD,CAAiB,eAAjB,EAAkC,mBAAlC;IADqB;;;;KAnBD,QAAQ,CAAC;;EAuB3B,IAAI,CAAC;;;;;;;oBACT,KAAA,GAAO,IAAI,CAAC;;;;KADW,QAAQ,CAAC;;EAI5B,IAAI,CAAC;;;;;;;uBACT,OAAA,GAAS;;uBACT,SAAA,GAAW;;uBACX,QAAA,GAAU,CAAA,CAAE,uBAAF,CAA0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