[Pkg-javascript-commits] [leaflet-markercluster] 10/479: Update leaflet to fix multiple adding causing event issues

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:00:03 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository leaflet-markercluster.

commit dd34b194b68a21d3a25645d11cb89b3752ab9af0
Author: danzel <danzel at localhost.geek.nz>
Date:   Thu Jul 12 16:59:47 2012 +1200

    Update leaflet to fix multiple adding causing event issues
---
 lib/leaflet-dist/leaflet-src.js | 19 ++++++++++++++++---
 lib/leaflet-dist/leaflet.js     |  2 +-
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/lib/leaflet-dist/leaflet-src.js b/lib/leaflet-dist/leaflet-src.js
index f7fe011..2b7624e 100644
--- a/lib/leaflet-dist/leaflet-src.js
+++ b/lib/leaflet-dist/leaflet-src.js
@@ -371,10 +371,19 @@ L.Mixin.Events.fire = L.Mixin.Events.fireEvent;
 		div = null;
 
 		return supported;
-	}());
+	}()),
+		ieversion = ie && (function () {
+			var re  = new RegExp("msie ([0-9]{1,}[\\.0-9]{0,})");
+			if (re.exec(ua) !== null) {
+				return parseFloat(RegExp.$1);
+			}
+			return null;
+		}());
 
 	L.Browser = {
+		ua: ua,
 		ie: ie,
+		iefilter: ie && ieversion < 9,
 		ie6: ie6,
 		webkit: webkit,
 		gecko: gecko,
@@ -715,8 +724,8 @@ L.DomUtil = {
 	},
 
 	setOpacity: function (el, value) {
-		if (L.Browser.ie) {
-		    el.style.filter += value !== 1 ? 'alpha(opacity=' + Math.round(value * 100) + ')' : '';
+		if (L.Browser.iefilter) {
+			el.style.filter += value !== 1 ? 'alpha(opacity=' + Math.round(value * 100) + ')' : '';
 		} else {
 			el.style.opacity = value;
 		}
@@ -3319,6 +3328,10 @@ L.FeatureGroup = L.LayerGroup.extend({
 	includes: L.Mixin.Events,
 
 	addLayer: function (layer) {
+		if (this._layers[L.Util.stamp(layer)]) {
+			return this;
+		}
+		
 		layer.on('click dblclick mouseover mouseout', this._propagateEvent, this);
 
 		L.LayerGroup.prototype.addLayer.call(this, layer);
diff --git a/lib/leaflet-dist/leaflet.js b/lib/leaflet-dist/leaflet.js
index e384e5b..118de0e 100644
--- a/lib/leaflet-dist/leaflet.js
+++ b/lib/leaflet-dist/leaflet.js
@@ -3,4 +3,4 @@
  Leaflet is a modern open-source JavaScript library for interactive maps.
  http://leaflet.cloudmade.com
 */
-(function(e,t){var n,r;typeof exports!=t+""?n=exports:(r=e.L,n={},n.noConflict=function(){return e.L=r,this},e.L=n),n.version="0.4",n.Util={extend:function(e){var t=Array.prototype.slice.call(arguments,1);for(var n=0,r=t.length,i;n<r;n++){i=t[n]||{};for(var s in i)i.hasOwnProperty(s)&&(e[s]=i[s])}return e},bind:function(e,t){var n=arguments.length>2?Array.prototype.slice.call(arguments,2):null;return function(){return e.apply(t,n||arguments)}},stamp:function(){var e=0,t="_leaflet_id";ret [...]
\ No newline at end of file
+(function(e,t){var n,r;typeof exports!=t+""?n=exports:(r=e.L,n={},n.noConflict=function(){return e.L=r,this},e.L=n),n.version="0.4",n.Util={extend:function(e){var t=Array.prototype.slice.call(arguments,1);for(var n=0,r=t.length,i;n<r;n++){i=t[n]||{};for(var s in i)i.hasOwnProperty(s)&&(e[s]=i[s])}return e},bind:function(e,t){var n=arguments.length>2?Array.prototype.slice.call(arguments,2):null;return function(){return e.apply(t,n||arguments)}},stamp:function(){var e=0,t="_leaflet_id";ret [...]
\ No newline at end of file

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/leaflet-markercluster.git



More information about the Pkg-javascript-commits mailing list