Skip to content

Commit

Permalink
Revert "Consistent mouse event propagation in Marker and Path"
Browse files Browse the repository at this point in the history
This reverts commit 4015f49.
  • Loading branch information
jfirebaugh committed Jun 28, 2013
1 parent 3f85f7c commit 475e736
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 38 deletions.
1 change: 0 additions & 1 deletion spec/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
<!-- /layer/vector/ -->
<script type="text/javascript" src="suites/layer/vector/CircleSpec.js"></script>
<script type="text/javascript" src="suites/layer/vector/CircleMarkerSpec.js"></script>
<script type="text/javascript" src="suites/layer/vector/PathSpec.js"></script>
<script type="text/javascript" src="suites/layer/vector/PolygonSpec.js"></script>
<script type="text/javascript" src="suites/layer/vector/PolylineSpec.js"></script>
<script type="text/javascript" src="suites/layer/vector/PolylineGeometrySpec.js"></script>
Expand Down
16 changes: 2 additions & 14 deletions spec/suites/layer/marker/MarkerSpec.js
Original file line number Diff line number Diff line change
@@ -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' }) });
Expand Down
19 changes: 0 additions & 19 deletions spec/suites/layer/vector/PathSpec.js

This file was deleted.

3 changes: 1 addition & 2 deletions src/layer/marker/Marker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/layer/vector/Path.SVG.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 475e736

Please sign in to comment.