[view/map][s] Listen to changes in the documents and update the map accordingly

This commit is contained in:
amercader 2012-04-24 19:06:51 +01:00
parent 653eda6f43
commit a516fc1deb

View File

@ -117,6 +117,10 @@ my.Map = Backbone.View.extend({
// Listen to changes in the documents
this.model.currentDocuments.bind('add', function(doc){self.redraw('add',doc)});
this.model.currentDocuments.bind('change', function(doc){
self.redraw('remove',doc);
self.redraw('add',doc);
});
this.model.currentDocuments.bind('remove', function(doc){self.redraw('remove',doc)});
this.model.currentDocuments.bind('reset', function(){self.redraw('reset')});