mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-20 15:34:49 +02:00
Enable curly and block-spacing eslint rules
This commit is contained in:
@@ -91,16 +91,12 @@ export function uiFieldAddress(field, context) {
|
||||
|
||||
function isAddressable(d) {
|
||||
if (d.tags.name) {
|
||||
if (d.tags.admin_level === '8' && d.tags.boundary === 'administrative')
|
||||
return true;
|
||||
if (d.tags.border_type === 'city')
|
||||
return true;
|
||||
if (d.tags.place === 'city' || d.tags.place === 'town' || d.tags.place === 'village')
|
||||
return true;
|
||||
if (d.tags.admin_level === '8' && d.tags.boundary === 'administrative') return true;
|
||||
if (d.tags.border_type === 'city') return true;
|
||||
if (d.tags.place === 'city' || d.tags.place === 'town' || d.tags.place === 'village') return true;
|
||||
}
|
||||
|
||||
if (d.tags['addr:city'])
|
||||
return true;
|
||||
if (d.tags['addr:city']) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -534,8 +534,10 @@ export function uiFieldRestrictions(field, context) {
|
||||
for (var i = 0; i < datum.via.ways.length; i++) {
|
||||
var prev = names[names.length - 1];
|
||||
var curr = displayName(datum.via.ways[i], vgraph);
|
||||
if (!prev || curr !== prev) // collapse identical names
|
||||
if (!prev || curr !== prev) {
|
||||
// collapse identical names
|
||||
names.push(curr);
|
||||
}
|
||||
}
|
||||
|
||||
help
|
||||
|
||||
@@ -49,7 +49,8 @@ var helpStringReplacements;
|
||||
// with custom `replacements`
|
||||
export function helpHtml(id, replacements) {
|
||||
// only load these the first time
|
||||
if (!helpStringReplacements) helpStringReplacements = {
|
||||
if (!helpStringReplacements) {
|
||||
helpStringReplacements = {
|
||||
// insert icons corresponding to various UI elements
|
||||
point_icon: icon('#iD-icon-point', 'inline'),
|
||||
line_icon: icon('#iD-icon-line', 'inline'),
|
||||
@@ -144,7 +145,8 @@ export function helpHtml(id, replacements) {
|
||||
start_the_walkthrough: t.html('splash.walkthrough'),
|
||||
help: t.html('help.title'),
|
||||
ok: t.html('intro.ok')
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
var reps;
|
||||
if (replacements) {
|
||||
@@ -255,10 +257,11 @@ export function selectMenuItem(context, operation) {
|
||||
|
||||
export function transitionTime(point1, point2) {
|
||||
var distance = geoSphericalDistance(point1, point2);
|
||||
if (distance === 0)
|
||||
if (distance === 0) {
|
||||
return 0;
|
||||
else if (distance < 80)
|
||||
} else if (distance < 80) {
|
||||
return 500;
|
||||
else
|
||||
} else {
|
||||
return 1000;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,12 +211,13 @@ export function uiIntroLine(context, reveal) {
|
||||
reveal('.surface', continueLineText);
|
||||
|
||||
context.on('enter.intro', function(mode) {
|
||||
if (mode.id === 'draw-line')
|
||||
if (mode.id === 'draw-line') {
|
||||
return;
|
||||
else if (mode.id === 'select')
|
||||
} else if (mode.id === 'select') {
|
||||
return continueTo(chooseCategoryRoad);
|
||||
else
|
||||
} else {
|
||||
return chapter.restart();
|
||||
}
|
||||
});
|
||||
|
||||
function continueTo(nextStep) {
|
||||
|
||||
@@ -23,18 +23,12 @@ export function uiPresetIcon() {
|
||||
|
||||
|
||||
function getIcon(p, geom) {
|
||||
if (isSmall() && p.isFallback && p.isFallback())
|
||||
return 'iD-icon-' + p.id;
|
||||
else if (p.icon)
|
||||
return p.icon;
|
||||
else if (geom === 'line')
|
||||
return 'iD-other-line';
|
||||
else if (geom === 'vertex')
|
||||
return p.isFallback() ? '' : 'temaki-vertex';
|
||||
else if (isSmall() && geom === 'point')
|
||||
return '';
|
||||
else
|
||||
return 'maki-marker-stroked';
|
||||
if (isSmall() && p.isFallback && p.isFallback()) return 'iD-icon-' + p.id;
|
||||
if (p.icon) return p.icon;
|
||||
if (geom === 'line') return 'iD-other-line';
|
||||
if (geom === 'vertex') return p.isFallback() ? '' : 'temaki-vertex';
|
||||
if (isSmall() && geom === 'point') return '';
|
||||
return 'maki-marker-stroked';
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user