Fixed js lint errors

private/hcvcastro/forking
Mihai Varga 2015-04-06 16:30:09 +03:00
parent f76216071e
commit 20195a3f43
13 changed files with 29 additions and 30 deletions

View File

@ -62,4 +62,4 @@ L.Tooltip = L.Class.extend({
}
return this;
}
});
});

View File

@ -21,9 +21,9 @@ L.Draw.Feature = L.Handler.extend({
L.Handler.prototype.enable.call(this);
this.fire('enabled', { handler: this.type });
this.fire('enabled', {handler: this.type});
this._map.fire('draw:drawstart', { layerType: this.type });
this._map.fire('draw:drawstart', {layerType: this.type});
},
disable: function () {
@ -31,9 +31,9 @@ L.Draw.Feature = L.Handler.extend({
L.Handler.prototype.disable.call(this);
this._map.fire('draw:drawstop', { layerType: this.type });
this._map.fire('draw:drawstop', {layerType: this.type});
this.fire('disabled', { handler: this.type });
this.fire('disabled', {handler: this.type});
},
addHooks: function () {
@ -66,7 +66,7 @@ L.Draw.Feature = L.Handler.extend({
},
_fireCreatedEvent: function (layer) {
this._map.fire('draw:created', { layer: layer, layerType: this.type });
this._map.fire('draw:created', {layer: layer, layerType: this.type});
},
// Cancel drawing when the escape key is pressed
@ -75,4 +75,4 @@ L.Draw.Feature = L.Handler.extend({
this.disable();
}
}
});
});

View File

@ -20,7 +20,7 @@ L.Draw.Marker = L.Draw.Feature.extend({
L.Draw.Feature.prototype.addHooks.call(this);
if (this._map) {
this._tooltip.updateContent({ text: L.drawLocal.draw.handlers.marker.tooltip.start });
this._tooltip.updateContent({text: L.drawLocal.draw.handlers.marker.tooltip.start});
// Same mouseMarker as in Draw.Polyline
if (!this._mouseMarker) {
@ -96,7 +96,7 @@ L.Draw.Marker = L.Draw.Feature.extend({
},
_fireCreatedEvent: function () {
var marker = new L.Marker(this._marker.getLatLng(), { icon: this.options.icon });
var marker = new L.Marker(this._marker.getLatLng(), {icon: this.options.icon});
L.Draw.Feature.prototype._fireCreatedEvent.call(this, marker);
}
});

View File

@ -387,11 +387,11 @@ L.Draw.Polyline = L.Draw.Feature.extend({
// Update tooltip
this._tooltip
.showAsError()
.updateContent({ text: this.options.drawError.message });
.updateContent({text: this.options.drawError.message});
// Update shape
this._updateGuideColor(this.options.drawError.color);
this._poly.setStyle({ color: this.options.drawError.color });
this._poly.setStyle({color: this.options.drawError.color});
// Hide the error after 2 seconds
this._clearHideErrorTimeout();
@ -410,7 +410,7 @@ L.Draw.Polyline = L.Draw.Feature.extend({
// Revert shape
this._updateGuideColor(this.options.shapeOptions.color);
this._poly.setStyle({ color: this.options.shapeOptions.color });
this._poly.setStyle({color: this.options.shapeOptions.color});
},
_clearHideErrorTimeout: function () {

View File

@ -23,7 +23,7 @@ L.Draw.SimpleShape = L.Draw.Feature.extend({
//TODO refactor: move cursor to styles
this._container.style.cursor = 'crosshair';
this._tooltip.updateContent({ text: this._initialLabelText });
this._tooltip.updateContent({text: this._initialLabelText});
this._map
.on('mousedown', this._onMouseDown, this)
@ -91,4 +91,4 @@ L.Draw.SimpleShape = L.Draw.Feature.extend({
this.enable();
}
}
});
});

View File

@ -60,4 +60,4 @@ L.Circle.addInitHook(function () {
this.editing.removeHooks();
}
});
});
});

View File

@ -35,7 +35,6 @@ L.Edit.Marker = L.Handler.extend({
if (!this._icon) {
return;
}
// This is quite naughty, but I don't see another way of doing it. (short of setting a new icon)
var icon = this._icon;

View File

@ -25,9 +25,9 @@ L.EditToolbar.Delete = L.Handler.extend({
if (this._enabled || !this._hasAvailableLayers()) {
return;
}
this.fire('enabled', { handler: this.type});
this.fire('enabled', {handler: this.type});
this._map.fire('draw:deletestart', { handler: this.type });
this._map.fire('draw:deletestart', {handler: this.type});
L.Handler.prototype.enable.call(this);
@ -45,9 +45,9 @@ L.EditToolbar.Delete = L.Handler.extend({
L.Handler.prototype.disable.call(this);
this._map.fire('draw:deletestop', { handler: this.type });
this._map.fire('draw:deletestop', {handler: this.type});
this.fire('disabled', { handler: this.type});
this.fire('disabled', {handler: this.type});
},
addHooks: function () {
@ -60,7 +60,7 @@ L.EditToolbar.Delete = L.Handler.extend({
this._deletedLayers = new L.LayerGroup();
this._tooltip = new L.Tooltip(this._map);
this._tooltip.updateContent({ text: L.drawLocal.edit.handlers.remove.tooltip.text });
this._tooltip.updateContent({text: L.drawLocal.edit.handlers.remove.tooltip.text});
this._map.on('mousemove', this._onMouseMove, this);
}
@ -82,12 +82,12 @@ L.EditToolbar.Delete = L.Handler.extend({
// Iterate of the deleted layers and add them back into the featureGroup
this._deletedLayers.eachLayer(function (layer) {
this._deletableLayers.addLayer(layer);
layer.fire('revert-deleted', { layer: layer });
layer.fire('revert-deleted', {layer: layer});
}, this);
},
save: function () {
this._map.fire('draw:deleted', { layers: this._deletedLayers });
this._map.fire('draw:deleted', {layers: this._deletedLayers});
},
_enableLayerDelete: function (e) {

View File

@ -30,7 +30,7 @@ L.EditToolbar.Edit = L.Handler.extend({
this.fire('enabled', {handler: this.type});
//this disable other handlers
this._map.fire('draw:editstart', { handler: this.type });
this._map.fire('draw:editstart', {handler: this.type});
//allow drawLayer to be updated before beginning edition.
L.Handler.prototype.enable.call(this);
@ -45,7 +45,7 @@ L.EditToolbar.Edit = L.Handler.extend({
.off('layeradd', this._enableLayerEdit, this)
.off('layerremove', this._disableLayerEdit, this);
L.Handler.prototype.disable.call(this);
this._map.fire('draw:editstop', { handler: this.type });
this._map.fire('draw:editstop', {handler: this.type});
this.fire('disabled', {handler: this.type});
},
@ -135,7 +135,7 @@ L.EditToolbar.Edit = L.Handler.extend({
layer.setLatLng(this._uneditedLayerProps[id].latlng);
}
layer.fire('revert-edited', { layer: layer });
layer.fire('revert-edited', {layer: layer});
}
},

View File

@ -65,4 +65,4 @@ L.GeometryUtil = L.extend(L.GeometryUtil || {}, {
return distanceStr;
}
});
});

View File

@ -15,4 +15,4 @@ L.LatLngUtil = {
cloneLatLng: function (latlng) {
return L.latLng(latlng.lat, latlng.lng);
}
};
};

View File

@ -12,4 +12,4 @@ L.Util.extend(L.LineUtil, {
_checkCounterclockwise: function (/*Point*/ p, /*Point*/ p1, /*Point*/ p2) {
return (p2.y - p.y) * (p1.x - p.x) > (p1.y - p.y) * (p2.x - p.x);
}
});
});

View File

@ -24,4 +24,4 @@ L.Polygon.include({
// Check the line segment between last and first point. Don't need to check the first line segment (minIndex = 1)
return this._lineSegmentsIntersectsRange(lastPoint, firstPoint, maxIndex, 1);
}
});
});