Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove trailing whitespace #73

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/draw/Control.Draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ L.Control.Draw = L.Control.extend({
initialize: function (options) {
L.Util.extend(this.options, options);
},

onAdd: function (map) {
var drawName = 'leaflet-control-draw', //TODO
barName = 'leaflet-bar',
partName = barName + '-part',
container = L.DomUtil.create('div', drawName + ' ' + barName),
buttons = [];

this.handlers = {};

if (this.options.polyline) {
this.handlers.polyline = new L.Polyline.Draw(map, this.options.polyline);
buttons.push(this._createButton(
Expand Down Expand Up @@ -95,7 +95,7 @@ L.Control.Draw = L.Control.extend({
));
this.handlers.marker.on('activated', this._disableInactiveModes, this);
}

if (buttons.length) {
// Add in the top and bottom classes so we get the border radius
L.DomUtil.addClass(buttons[0], partName + '-top');
Expand Down
4 changes: 2 additions & 2 deletions src/draw/Handler.Draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ L.Handler.Draw = L.Handler.extend({
this._map.fire('drawing-disabled', { drawingType: this.type });
L.Handler.prototype.disable.call(this);
},

addHooks: function () {
if (this._map) {
L.DomUtil.disableTextSelection();
Expand Down Expand Up @@ -75,4 +75,4 @@ L.Handler.Draw = L.Handler.extend({
this.disable();
}
}
});
});
2 changes: 1 addition & 1 deletion src/draw/shapes/Circle.Draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ L.Circle.Draw = L.SimpleShape.Draw.extend({
{ circ: new L.Circle(this._startLatLng, this._shape.getRadius(), this.options.shapeOptions) }
);
}
});
});
8 changes: 4 additions & 4 deletions src/draw/shapes/Marker.Draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ L.Marker.Draw = L.Handler.Draw.extend({
icon: new L.Icon.Default(),
zIndexOffset: 2000 // This should be > than the highest z-index any markers
},

addHooks: function () {
L.Handler.Draw.prototype.addHooks.call(this);

if (this._map) {
this._updateLabelText({ text: 'Click map to place marker.' });
this._map.on('mousemove', this._onMouseMove, this);
Expand All @@ -17,7 +17,7 @@ L.Marker.Draw = L.Handler.Draw.extend({

removeHooks: function () {
L.Handler.Draw.prototype.removeHooks.call(this);

if (this._map) {
if (this._marker) {
this._marker.off('click', this._onClick);
Expand Down Expand Up @@ -60,4 +60,4 @@ L.Marker.Draw = L.Handler.Draw.extend({
);
this.disable();
}
});
});
4 changes: 2 additions & 2 deletions src/draw/shapes/Polygon.Draw.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
L.Polygon.Draw = L.Polyline.Draw.extend({
Poly: L.Polygon,

type: 'polygon',

options: {
Expand Down Expand Up @@ -50,4 +50,4 @@ L.Polygon.Draw = L.Polyline.Draw.extend({
this._markers[0].off('click', this._finishShape);
}
}
});
});
20 changes: 10 additions & 10 deletions src/draw/shapes/Polyline.Draw.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
L.Polyline.Draw = L.Handler.Draw.extend({
Poly: L.Polyline,

type: 'polyline',

options: {
Expand Down Expand Up @@ -33,7 +33,7 @@ L.Polyline.Draw = L.Handler.Draw.extend({
}
L.Handler.Draw.prototype.initialize.call(this, map, options);
},

addHooks: function () {
L.Handler.Draw.prototype.addHooks.call(this);
if (this._map) {
Expand Down Expand Up @@ -77,7 +77,7 @@ L.Polyline.Draw = L.Handler.Draw.extend({
this._clearHideErrorTimeout();

this._cleanUpShape();

// remove markers from map
this._map.removeLayer(this._markerGroup);
delete this._markerGroup;
Expand Down Expand Up @@ -176,19 +176,19 @@ L.Polyline.Draw = L.Handler.Draw.extend({
if (this._markers.length > 1) {
this._markers[this._markers.length - 1].on('click', this._finishShape, this);
}

// Remove the old marker click handler (as only the last point should close the polyline)
if (this._markers.length > 2) {
this._markers[this._markers.length - 2].off('click', this._finishShape);
}
},

_createMarker: function (latlng) {
var marker = new L.Marker(latlng, {
icon: this.options.icon,
zIndexOffset: this.options.zIndexOffset * 2
});

this._markerGroup.addLayer(marker);

return marker;
Expand All @@ -205,7 +205,7 @@ L.Polyline.Draw = L.Handler.Draw.extend({
if (!this._guidesContainer) {
this._guidesContainer = L.DomUtil.create('div', 'leaflet-draw-guides', this._overlayPane);
}

//draw a dash every GuildeLineDistance
for (i = this.options.guidelineDistance; i < length; i += this.options.guidelineDistance) {
//work out fraction along line we are
Expand Down Expand Up @@ -263,7 +263,7 @@ L.Polyline.Draw = L.Handler.Draw.extend({
distance = this._measurementRunningTotal + this._currentLatLng.distanceTo(this._markers[this._markers.length - 1].getLatLng());
// show metres when distance is < 1km, then show km
distanceStr = distance > 1000 ? (distance / 1000).toFixed(2) + ' km' : Math.ceil(distance) + ' m';

if (this._markers.length === 1) {
labelText = {
text: 'Click to continue drawing line.',
Expand Down Expand Up @@ -300,7 +300,7 @@ L.Polyline.Draw = L.Handler.Draw.extend({
this._errorShown = false;

this._clearHideErrorTimeout();

// Revert label
L.DomUtil.removeClass(this._label, 'leaflet-error-draw-label');
L.DomUtil.removeClass(this._label, 'leaflet-flash-anim');
Expand Down Expand Up @@ -333,4 +333,4 @@ L.Polyline.Draw = L.Handler.Draw.extend({
this._markers[this._markers.length - 1].off('click', this._finishShape);
}
}
});
});
4 changes: 2 additions & 2 deletions src/draw/shapes/Rectangle.Draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ L.Rectangle.Draw = L.SimpleShape.Draw.extend({
clickable: true
}
},

_initialLabelText: 'Click and drag to draw rectangle.',

_drawShape: function (latlng) {
Expand All @@ -31,4 +31,4 @@ L.Rectangle.Draw = L.SimpleShape.Draw.extend({
{ rect: new L.Rectangle(this._shape.getBounds(), this.options.shapeOptions) }
);
}
});
});
4 changes: 2 additions & 2 deletions src/draw/shapes/SimpleShape.Draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ L.SimpleShape.Draw = L.Handler.Draw.extend({
if (this._shape) {
this._fireCreatedEvent();
}

this.disable();
}
});
});
3 changes: 1 addition & 2 deletions src/ext/Polyline.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ L.Polyline.include({
p = points[i - 1];
p1 = points[i];


if (this._lineSegmentsIntersectsRange(p, p1, i - 2)) {
return true;
}
Expand Down Expand Up @@ -82,4 +81,4 @@ L.Polyline.include({

return false;
}
});
});