[Pkg-javascript-commits] [leaflet] 13/78: Implement contextclick and dblclick for canvas paths, fixes #3481
Jonas Smedegaard
dr at jones.dk
Sat May 7 08:58:42 UTC 2016
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository leaflet.
commit 3cec7fc1d43f978e1152d939b1f091272472880b
Author: Iván Sánchez Ortega <ivan at mazemap.no>
Date: Wed May 20 09:58:34 2015 +0200
Implement contextclick and dblclick for canvas paths, fixes #3481
---
src/layer/vector/canvas/Path.Canvas.js | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/layer/vector/canvas/Path.Canvas.js b/src/layer/vector/canvas/Path.Canvas.js
index 818abc2..778d8af 100644
--- a/src/layer/vector/canvas/Path.Canvas.js
+++ b/src/layer/vector/canvas/Path.Canvas.js
@@ -132,15 +132,14 @@ L.Path = (L.Path.SVG && !window.L_PREFER_CANVAS) || !L.Browser.canvas ? L.Path :
_initEvents: function () {
if (this.options.clickable) {
- // TODO dblclick
this._map.on('mousemove', this._onMouseMove, this);
- this._map.on('click', this._onClick, this);
+ this._map.on('click dblclick contextmenu', this._fireMouseEvent, this);
}
},
- _onClick: function (e) {
+ _fireMouseEvent: function (e) {
if (this._containsPoint(e.layerPoint)) {
- this.fire('click', e);
+ this.fire(e.type, e);
}
},
--
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