From a516fc1deb0ce0a5261ed61f20ad641298a47ca1 Mon Sep 17 00:00:00 2001 From: amercader Date: Tue, 24 Apr 2012 19:06:51 +0100 Subject: [PATCH] [view/map][s] Listen to changes in the documents and update the map accordingly --- src/view-map.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/view-map.js b/src/view-map.js index 65cfed0f..e6537614 100644 --- a/src/view-map.js +++ b/src/view-map.js @@ -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')});