[Pkg-javascript-commits] [leaflet] 99/301: add public Popup update method, close #1959
Jonas Smedegaard
js at moszumanska.debian.org
Mon Jan 27 22:22:44 UTC 2014
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository leaflet.
commit 4b343624057430f46942cf58117fa504f33a4bb5
Author: Vladimir Agafonkin <agafonkin at gmail.com>
Date: Fri Sep 13 18:00:54 2013 +0300
add public Popup update method, close #1959
---
src/layer/Popup.js | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/src/layer/Popup.js b/src/layer/Popup.js
index 760b325..3137ac3 100644
--- a/src/layer/Popup.js
+++ b/src/layer/Popup.js
@@ -49,7 +49,7 @@ L.Popup = L.Class.extend({
map.on(this._getEvents(), this);
- this._update();
+ this.update();
if (animFade) {
L.DomUtil.setOpacity(this._container, 1);
@@ -98,16 +98,30 @@ L.Popup = L.Class.extend({
setLatLng: function (latlng) {
this._latlng = L.latLng(latlng);
- this._update();
+ this.update();
return this;
},
setContent: function (content) {
this._content = content;
- this._update();
+ this.update();
return this;
},
+ update: function () {
+ if (!this._map) { return; }
+
+ this._container.style.visibility = 'hidden';
+
+ this._updateContent();
+ this._updateLayout();
+ this._updatePosition();
+
+ this._container.style.visibility = '';
+
+ this._adjustPan();
+ },
+
_getEvents: function () {
var events = {
viewreset: this._updatePosition
@@ -161,20 +175,6 @@ L.Popup = L.Class.extend({
this._tip = L.DomUtil.create('div', prefix + '-tip', this._tipContainer);
},
- _update: function () {
- if (!this._map) { return; }
-
- this._container.style.visibility = 'hidden';
-
- this._updateContent();
- this._updateLayout();
- this._updatePosition();
-
- this._container.style.visibility = '';
-
- this._adjustPan();
- },
-
_updateContent: function () {
if (!this._content) { return; }
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/leaflet.git
More information about the Pkg-javascript-commits
mailing list