code quality improvements (unused vars, duplicate css selectors, etc.) (#8965)

* mark function parameter as currently unused
* refactor some unused function parameters
* consolidate some css selectors
This commit is contained in:
Martin Raifer
2022-02-07 15:30:53 +01:00
committed by GitHub
parent 63cdee211f
commit ad67f81cfd
9 changed files with 22 additions and 33 deletions
+1 -3
View File
@@ -623,14 +623,12 @@ path.line.stroke.tag-highway-cycleway.tag-crossing-marked {
path.line.stroke.tag-highway.tag-footway-access_aisle {
stroke-dasharray: 4, 2;
stroke: #4c4444;
}
.low-zoom path.line.stroke.tag-highway.tag-footway-access_aisle,
.preset-icon-container path.stroke.tag-highway.tag-footway-access_aisle {
stroke-dasharray: 2.5, 1.5;
}
path.line.stroke.tag-highway.tag-footway-access_aisle {
stroke: #4c4444;
}
.preset-icon .icon.tag-highway.tag-footway-access_aisle {
color: #4c4444;
}
+2 -9
View File
@@ -20,10 +20,12 @@ path.line.shadow.tag-taxiway {
}
path.line.casing.tag-aeroway-taxiway,
path.line.casing.tag-taxiway {
stroke: #666;
stroke-width: 7;
}
path.line.stroke.tag-aeroway-taxiway,
path.line.stroke.tag-taxiway {
stroke: #ff0;
stroke-width: 5;
}
.low-zoom path.line.shadow.tag-aeroway-taxiway,
@@ -39,15 +41,6 @@ path.line.stroke.tag-taxiway {
stroke-width: 3;
}
path.line.stroke.tag-aeroway-taxiway,
path.line.stroke.tag-taxiway {
stroke: #ff0;
}
path.line.casing.tag-aeroway-taxiway,
path.line.casing.tag-taxiway {
stroke: #666;
}
/* wide aeroways (runway) */
.preset-icon .icon.tag-aeroway-runway,
.preset-icon .icon.tag-runway {
+2 -6
View File
@@ -66,6 +66,7 @@ path.line.shadow.tag-route-ferry {
stroke-width: 16;
}
path.line.stroke.tag-route-ferry {
stroke: #58a9ed;
stroke-width: 3;
stroke-linecap: butt;
stroke-dasharray: 12,8;
@@ -78,9 +79,6 @@ path.line.stroke.tag-route-ferry {
stroke-width: 2;
stroke-dasharray: 6,4;
}
path.line.stroke.tag-route-ferry {
stroke: #58a9ed;
}
path.line.casing.tag-route-ferry {
stroke: none;
}
@@ -238,15 +236,13 @@ path.line.stroke.tag-barrier.tag-barrier-city_wall {
path.line.casing.tag-bridge {
stroke-opacity: 0.6;
stroke: #000 !important;
stroke-width: 16;
stroke-linecap: butt;
stroke-dasharray: none;
}
path.line.shadow.tag-bridge {
stroke-width: 24;
}
path.line.casing.tag-bridge {
stroke-width: 16;
}
.low-zoom path.line.shadow.tag-bridge {
stroke-width: 16;
}
+1 -1
View File
@@ -3068,7 +3068,7 @@ img.tag-reference-wiki-image {
/* Fullscreen Button (disabled)
------------------------------------------------------- */
div.full-screen {
display: inline-block;
/*display: inline-block;*/
width: 40px;
margin-right: 10px;
display: none;
+1 -1
View File
@@ -335,7 +335,7 @@ export function behaviorSelect(context) {
.selectedNoteID(datum.id)
.enter(modeSelectNote(context, datum.id));
} else if (datum instanceof QAItem & !isMultiselect) {
} else if (datum instanceof QAItem && !isMultiselect) {
// targeting an external QA issue
context
.selectedErrorID(datum.id)
+4 -2
View File
@@ -14,7 +14,7 @@ import { t } from '../../core/localizer';
import { svgIcon } from '../../svg';
import { uiTooltip } from '../tooltip';
export function uiToolOldDrawModes(context) {
export function uiToolDrawModes(context) {
var tool = {
id: 'old_modes',
@@ -46,7 +46,9 @@ export function uiToolOldDrawModes(context) {
];
function enabled() {
function enabled(
_mode // parameter is currently not used, but might be at some point
) {
return osmEditable();
}
+4 -4
View File
@@ -35,7 +35,7 @@ export function uiToolNotes(context) {
}
context.keybinding().on(mode.key, function() {
if (!enabled(mode)) return;
if (!enabled()) return;
if (mode.id === context.mode().id) {
context.enter(modeBrowse(context));
@@ -74,7 +74,7 @@ export function uiToolNotes(context) {
.append('button')
.attr('class', function(d) { return d.id + ' add-button bar-button'; })
.on('click.notes', function(d3_event, d) {
if (!enabled(d)) return;
if (!enabled()) return;
// When drawing, ignore accidental clicks on mode buttons - #4042
var currMode = context.mode().id;
@@ -107,8 +107,8 @@ export function uiToolNotes(context) {
// update
buttons = buttons
.merge(buttonsEnter)
.classed('disabled', function(d) { return !enabled(d); })
.attr('aria-disabled', function(d) { return !enabled(d); })
.classed('disabled', function() { return !enabled(); })
.attr('aria-disabled', function() { return !enabled(); })
.classed('active', function(d) { return context.mode() && context.mode().button === d.button; })
.attr('aria-pressed', function(d) { return context.mode() && context.mode().button === d.button; });
}
+5 -5
View File
@@ -36,15 +36,15 @@ export function uiToolSave(context) {
}
}
function bgColor() {
function bgColor(numChanges) {
var step;
if (_numChanges === 0) {
if (numChanges === 0) {
return null;
} else if (_numChanges <= 50) {
step = _numChanges / 50;
} else if (numChanges <= 50) {
step = numChanges / 50;
return d3_interpolateRgb('#fff', '#ff8')(step); // white -> yellow
} else {
step = Math.min((_numChanges - 50) / 50, 1.0);
step = Math.min((numChanges - 50) / 50, 1.0);
return d3_interpolateRgb('#ff8', '#f88')(step); // yellow -> red
}
}
+2 -2
View File
@@ -3,13 +3,13 @@ import {
} from 'd3-selection';
import _debounce from 'lodash-es/debounce';
import { uiToolOldDrawModes, uiToolNotes, uiToolSave, uiToolSidebarToggle, uiToolUndoRedo } from './tools';
import { uiToolDrawModes, uiToolNotes, uiToolSave, uiToolSidebarToggle, uiToolUndoRedo } from './tools';
export function uiTopToolbar(context) {
var sidebarToggle = uiToolSidebarToggle(context),
modes = uiToolOldDrawModes(context),
modes = uiToolDrawModes(context),
notes = uiToolNotes(context),
undoRedo = uiToolUndoRedo(context),
save = uiToolSave(context);