[Pkg-javascript-commits] [leaflet] 223/301: Don't delay moveend event on invalidateSize

Jonas Smedegaard js at moszumanska.debian.org
Mon Jan 27 22:22:53 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 248c5e7c8fc1e6a3e94d0b6c44fa92e6f4e403db
Author: John Firebaugh <john.firebaugh at gmail.com>
Date:   Mon Nov 11 13:59:42 2013 -0800

    Don't delay moveend event on invalidateSize
    
    This causes unnecessary nondeterminism in the sequence of
    events emitted. Instead, the caller should be responsible for
    throttling, as e.g. Map#_onResize does.
---
 src/map/Map.js | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/map/Map.js b/src/map/Map.js
index 35b7739..e8c4057 100644
--- a/src/map/Map.js
+++ b/src/map/Map.js
@@ -288,11 +288,7 @@ L.Map = L.Class.extend({
 				this._rawPanBy(offset);
 			}
 
-			this.fire('move');
-
-			// make sure moveend is not fired too often on resize
-			clearTimeout(this._sizeTimer);
-			this._sizeTimer = setTimeout(L.bind(this.fire, this, 'moveend'), 200);
+			this.fire('move').fire('moveend');
 		}
 
 		return this.fire('resize', {

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