Skip to content

Commit

Permalink
Update popup in the afterRender queue
Browse files Browse the repository at this point in the history
When the popup is first rendered, it may be a different size than
after ember finishes rendering. This change ensures the popup will
always be visible if autoPan is enabled (the default)
  • Loading branch information
alexspeller committed Dec 7, 2014
1 parent 48f32fd commit 058a979
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
10 changes: 8 additions & 2 deletions dist/ember-leaflet.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Version: v0.6.0-1-g78d74a3
// Last commit: 78d74a3 (2014-06-19 14:10:45 -0700)
// Version: v0.6.0-5-gdd38076
// Last commit: dd38076 (2014-12-03 02:26:38 +0000)


(function() {
Expand Down Expand Up @@ -677,6 +677,12 @@ EmberLeaflet.PopupMixin = Ember.Mixin.create({
this._popupView._insertElementLater(function() {
self._popupView.$().appendTo(self._popup._contentNode);
});

// After the view has rendered, call update to ensure
// popup is visible with autoPan
Ember.run.schedule('afterRender', this, function() {
self._popup.update();
});
},

_destroyPopupContent: function() {
Expand Down
Loading

0 comments on commit 058a979

Please sign in to comment.