[view-map,bugfix][xs]: only call invalidateMapsize on view:show if map defined.

* this issue arose in case when map is the first view being shown.
This commit is contained in:
Rufus Pollock 2012-04-17 05:27:09 +01:00
parent bdbfdd7c34
commit 5eb65f2b77

View File

@ -117,7 +117,9 @@ my.Map = Backbone.View.extend({
// If the div was hidden, Leaflet needs to recalculate some sizes
// to display properly
this.bind('view:show',function(){
self.map.invalidateSize();
if (self.map) {
self.map.invalidateSize();
}
});
var stateData = _.extend({