diff --git a/spec/index.html b/spec/index.html index cf3b7a8fdfa..6454bc2f4cd 100644 --- a/spec/index.html +++ b/spec/index.html @@ -67,7 +67,6 @@ - diff --git a/spec/suites/layer/marker/MarkerSpec.js b/spec/suites/layer/marker/MarkerSpec.js index ccfb7d4f647..082de250d6f 100644 --- a/spec/suites/layer/marker/MarkerSpec.js +++ b/spec/suites/layer/marker/MarkerSpec.js @@ -1,22 +1,10 @@ describe("Marker", function () { - var map; - + var map, + spy; beforeEach(function () { map = L.map(document.createElement('div')).setView([0, 0], 0); }); - it("propagates events from the icon", function() { - var events = ['mousedown', 'mouseup', 'mouseover', 'mouseout', - 'mousemove', 'dblclick']; - for (var i = 0; i < events.length; i++) { - var marker = new L.Marker([0, 0]).addTo(map), - spy = sinon.spy(); - marker.on(events[i], spy); - happen[events[i]](marker._icon); - expect(spy.called).to.be.ok(); - } - }); - describe("#setIcon", function () { it("changes the icon to another image", function () { var marker = new L.Marker([0, 0], {icon: new L.Icon({iconUrl: 'icon1.png' }) }); diff --git a/spec/suites/layer/vector/PathSpec.js b/spec/suites/layer/vector/PathSpec.js deleted file mode 100644 index 41459e83d4b..00000000000 --- a/spec/suites/layer/vector/PathSpec.js +++ /dev/null @@ -1,19 +0,0 @@ -describe("Path", function() { - var map; - - beforeEach(function () { - map = L.map(document.createElement('div')).setView([0, 0], 0); - }); - - it("propagates events from the container", function() { - var events = ['mousedown', 'mouseup', 'mouseover', 'mouseout', - 'mousemove', 'dblclick']; - for (var i = 0; i < events.length; i++) { - var path = new L.Path().addTo(map), - spy = sinon.spy(); - path.on(events[i], spy); - happen[events[i]](path._container); - expect(spy.called).to.be.ok(); - } - }); -}); diff --git a/src/layer/marker/Marker.js b/src/layer/marker/Marker.js index c12d3c74547..d524a4cd20a 100644 --- a/src/layer/marker/Marker.js +++ b/src/layer/marker/Marker.js @@ -214,8 +214,7 @@ L.Marker = L.Class.extend({ // TODO refactor into something shared with Map/Path/etc. to DRY it up var icon = this._icon, - events = ['mousedown', 'mouseup', 'mouseover', 'mouseout', - 'mousemove', 'dblclick', 'contextmenu']; + events = ['dblclick', 'mousedown', 'mouseover', 'mouseout', 'contextmenu']; L.DomUtil.addClass(icon, 'leaflet-clickable'); L.DomEvent.on(icon, 'click', this._onMouseClick, this); diff --git a/src/layer/vector/Path.SVG.js b/src/layer/vector/Path.SVG.js index 3b5964771aa..723b8edddce 100644 --- a/src/layer/vector/Path.SVG.js +++ b/src/layer/vector/Path.SVG.js @@ -109,8 +109,8 @@ L.Path = L.Path.extend({ L.DomEvent.on(this._container, 'click', this._onMouseClick, this); - var events = ['mousedown', 'mouseup', 'mouseover', 'mouseout', - 'mousemove', 'dblclick', 'contextmenu']; + var events = ['dblclick', 'mousedown', 'mouseover', + 'mouseout', 'mousemove', 'contextmenu']; for (var i = 0; i < events.length; i++) { L.DomEvent.on(this._container, events[i], this._fireMouseEvent, this); }