From 9445c2f9f277f74ae7176bdabacf3a9bfcd07aae Mon Sep 17 00:00:00 2001 From: AndreyGeonya Date: Tue, 5 Aug 2014 18:14:02 +0300 Subject: [PATCH] this commit fixes #2499 --- debug/tests/click_on_canvas.html | 2 +- debug/tests/svg_clicks.html | 2 +- dist/leaflet.css | 6 +++--- src/layer/marker/Marker.js | 6 +++--- src/layer/vector/Canvas.js | 6 +++--- src/layer/vector/Path.js | 2 +- src/layer/vector/SVG.js | 6 +++--- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/debug/tests/click_on_canvas.html b/debug/tests/click_on_canvas.html index f4a6b9c0..ac9b21f4 100644 --- a/debug/tests/click_on_canvas.html +++ b/debug/tests/click_on_canvas.html @@ -35,7 +35,7 @@ opacity: 1, smoothFactor: 1, color: 'red', - clickable:true + interactive:true })); polygons.on('click', function(m) { diff --git a/debug/tests/svg_clicks.html b/debug/tests/svg_clicks.html index 11be258e..706f3456 100644 --- a/debug/tests/svg_clicks.html +++ b/debug/tests/svg_clicks.html @@ -43,7 +43,7 @@ [51, 7.000], [51.002, 7.004] ], - { clickable:false,color:'#f00' } + { interactive:false,color:'#f00' } ).addTo(map); // when the mouse hovers over the red route2, you cannot click through the blue route1 beneath diff --git a/dist/leaflet.css b/dist/leaflet.css index 06dd0512..4f746154 100644 --- a/dist/leaflet.css +++ b/dist/leaflet.css @@ -171,7 +171,7 @@ /* cursors */ -.leaflet-clickable { +.leaflet-interactive { cursor: pointer; } .leaflet-container { @@ -179,7 +179,7 @@ cursor: -moz-grab; } .leaflet-crosshair, -.leaflet-crosshair .leaflet-clickable { +.leaflet-crosshair .leaflet-interactive { cursor: crosshair; } .leaflet-popup-pane, @@ -187,7 +187,7 @@ cursor: auto; } .leaflet-dragging .leaflet-container, -.leaflet-dragging .leaflet-clickable { +.leaflet-dragging .leaflet-interactive { cursor: move; cursor: -webkit-grabbing; cursor: -moz-grabbing; diff --git a/src/layer/marker/Marker.js b/src/layer/marker/Marker.js index 8636f35d..2bc92a19 100644 --- a/src/layer/marker/Marker.js +++ b/src/layer/marker/Marker.js @@ -10,7 +10,7 @@ L.Marker = L.Layer.extend({ icon: new L.Icon.Default(), // title: '', // alt: '', - clickable: true, + interactive: true, // draggable: false, keyboard: true, zIndexOffset: 0, @@ -201,9 +201,9 @@ L.Marker = L.Layer.extend({ _initInteraction: function () { - if (!this.options.clickable) { return; } + if (!this.options.interactive) { return; } - L.DomUtil.addClass(this._icon, 'leaflet-clickable'); + L.DomUtil.addClass(this._icon, 'leaflet-interactive'); L.DomEvent.on(this._icon, 'click dblclick mousedown mouseup mouseover mousemove mouseout contextmenu keypress', this._fireMouseEvent, this); diff --git a/src/layer/vector/Canvas.js b/src/layer/vector/Canvas.js index 59580090..e05f2d3e 100644 --- a/src/layer/vector/Canvas.js +++ b/src/layer/vector/Canvas.js @@ -207,12 +207,12 @@ L.Canvas = L.Renderer.extend({ }, _handleHover: function (layer, e, point) { - if (!layer.options.clickable) { return; } + if (!layer.options.interactive) { return; } if (layer._containsPoint(point)) { // if we just got inside the layer, fire mouseover if (!layer._mouseInside) { - L.DomUtil.addClass(this._container, 'leaflet-clickable'); // change cursor + L.DomUtil.addClass(this._container, 'leaflet-interactive'); // change cursor layer._fireMouseEvent(e, 'mouseover'); layer._mouseInside = true; } @@ -221,7 +221,7 @@ L.Canvas = L.Renderer.extend({ } else if (layer._mouseInside) { // if we're leaving the layer, fire mouseout - L.DomUtil.removeClass(this._container, 'leaflet-clickable'); + L.DomUtil.removeClass(this._container, 'leaflet-interactive'); layer._fireMouseEvent(e, 'mouseout'); layer._mouseInside = false; } diff --git a/src/layer/vector/Path.js b/src/layer/vector/Path.js index d4dea2a2..70e575ad 100644 --- a/src/layer/vector/Path.js +++ b/src/layer/vector/Path.js @@ -19,7 +19,7 @@ L.Path = L.Layer.extend({ fillOpacity: 0.2, // className: '' - clickable: true + interactive: true }, onAdd: function () { diff --git a/src/layer/vector/SVG.js b/src/layer/vector/SVG.js index 1bc01eb2..553bb7e4 100644 --- a/src/layer/vector/SVG.js +++ b/src/layer/vector/SVG.js @@ -56,8 +56,8 @@ L.SVG = L.Renderer.extend({ L.DomUtil.addClass(path, layer.options.className); } - if (layer.options.clickable) { - L.DomUtil.addClass(path, 'leaflet-clickable'); + if (layer.options.interactive) { + L.DomUtil.addClass(path, 'leaflet-interactive'); } this._updateStyle(layer); @@ -116,7 +116,7 @@ L.SVG = L.Renderer.extend({ path.setAttribute('fill', 'none'); } - path.setAttribute('pointer-events', options.pointerEvents || (options.clickable ? 'visiblePainted' : 'none')); + path.setAttribute('pointer-events', options.pointerEvents || (options.interactive ? 'visiblePainted' : 'none')); }, _updatePoly: function (layer, closed) {