[Pkg-javascript-commits] [leaflet] 16/40: fix error dragging outside of window in FF, close #2610

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:33:07 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 1335c77066e96e9ce437933d1e0da90755f9c4e0
Author: Vladimir Agafonkin <agafonkin at gmail.com>
Date:   Mon Apr 28 15:59:30 2014 +0300

    fix error dragging outside of window in FF, close #2610
---
 src/dom/Draggable.js | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/dom/Draggable.js b/src/dom/Draggable.js
index eea0cd2..b804a03 100644
--- a/src/dom/Draggable.js
+++ b/src/dom/Draggable.js
@@ -93,7 +93,8 @@ L.Draggable = L.Class.extend({
 			this._startPos = L.DomUtil.getPosition(this._element).subtract(offset);
 
 			L.DomUtil.addClass(document.body, 'leaflet-dragging');
-			L.DomUtil.addClass((e.target || e.srcElement), 'leaflet-drag-target');
+			this._lastTarget = e.target || e.srcElement;
+			L.DomUtil.addClass(this._lastTarget, 'leaflet-drag-target');
 		}
 
 		this._newPos = this._startPos.add(offset);
@@ -111,7 +112,11 @@ L.Draggable = L.Class.extend({
 
 	_onUp: function (e) {
 		L.DomUtil.removeClass(document.body, 'leaflet-dragging');
-		L.DomUtil.removeClass((e.target || e.srcElement), 'leaflet-drag-target');
+
+		if (this._lastTarget) {
+			L.DomUtil.removeClass(this._lastTarget, 'leaflet-drag-target');
+			this._lastTarget = null;
+		}
 
 		for (var i in L.Draggable.MOVE) {
 			L.DomEvent

-- 
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