diff --git a/app/static/js/CanvasCoordinateSystem.js b/app/static/js/CanvasCoordinateSystem.js index 9e300a1..ba9a96b 100644 --- a/app/static/js/CanvasCoordinateSystem.js +++ b/app/static/js/CanvasCoordinateSystem.js @@ -94,7 +94,9 @@ class CanvasCoordinateSystem { } drawPath(points, color = 'red', width = 2) { - if (!points || points.length < 2) return; + if (!points || points.length < 2) { + return; + } this.ctx.beginPath(); this.ctx.moveTo(points[0].x, points[0].y); diff --git a/app/static/js/compare.js b/app/static/js/compare.js index ab241b3..c4390fc 100644 --- a/app/static/js/compare.js +++ b/app/static/js/compare.js @@ -80,7 +80,9 @@ function updateTeamCards(data) { const cardNum = index + 1; const cardId = `team${cardNum}-info`; const card = document.getElementById(cardId); - if (!card) return; + if (!card) { + return; + } // Show the card card.classList.remove('hidden'); @@ -124,13 +126,17 @@ function updateTeamCards(data) { // Hide team3 card if no third team if (Object.keys(data).length < 3) { const team3Card = document.getElementById('team3-info'); - if (team3Card) team3Card.classList.add('hidden'); + if (team3Card) { + team3Card.classList.add('hidden'); + } } } function updateRadarChart(data) { const canvas = document.getElementById('radarChart'); - if (!canvas) return; + if (!canvas) { + return; + } if (radarChart) { radarChart.destroy(); @@ -197,7 +203,9 @@ window.addEventListener('resize', () => { function updateRawDataTable(data) { const tbody = document.getElementById('raw-data-tbody'); - if (!tbody) return; + if (!tbody) { + return; + } tbody.innerHTML = ''; @@ -310,7 +318,9 @@ function resizeModalCanvas() { } function redrawPaths() { - if (!modalCoordSystem || !currentPathData) return; + if (!modalCoordSystem || !currentPathData) { + return; + } modalCoordSystem.clear(); @@ -346,7 +356,9 @@ function redrawPaths() { } function zoomIn(event) { - if (!modalCoordSystem) return; + if (!modalCoordSystem) { + return; + } const rect = modalCanvas.getBoundingClientRect(); let mouseX = rect.width / 2; let mouseY = rect.height / 2; @@ -356,7 +368,9 @@ function zoomIn(event) { } function zoomOut(event) { - if (!modalCoordSystem) return; + if (!modalCoordSystem) { + return; + } const rect = modalCanvas.getBoundingClientRect(); let mouseX = rect.width / 2; let mouseY = rect.height / 2; @@ -366,7 +380,9 @@ function zoomOut(event) { } function resetZoom() { - if (!modalCoordSystem) return; + if (!modalCoordSystem) { + return; + } modalCoordSystem.resetView(); redrawPaths(); } diff --git a/app/static/js/scout.edit.js b/app/static/js/scout.edit.js index c778799..c69885b 100644 --- a/app/static/js/scout.edit.js +++ b/app/static/js/scout.edit.js @@ -119,7 +119,9 @@ function startDrawing(e) { } function draw(e) { - if (!isDrawing) return; + if (!isDrawing) { + return; + } e.preventDefault(); const point = getPointFromEvent(e); currentPath.push(point); @@ -127,7 +129,9 @@ function draw(e) { } function stopDrawing(e) { - if (!isDrawing) return; + if (!isDrawing) { + return; + } e.preventDefault(); isDrawing = false; if (currentPath.length > 1) { @@ -176,7 +180,9 @@ function resetZoom() { } function zoomIn(event) { - if (!coordSystem) return; + if (!coordSystem) { + return; + } const rect = canvas.getBoundingClientRect(); let mouseX, mouseY; @@ -196,7 +202,9 @@ function zoomIn(event) { } function zoomOut(event) { - if (!coordSystem) return; + if (!coordSystem) { + return; + } const rect = canvas.getBoundingClientRect(); let mouseX, mouseY; diff --git a/app/static/js/scout.list.js b/app/static/js/scout.list.js index b7ce91a..620d2f2 100644 --- a/app/static/js/scout.list.js +++ b/app/static/js/scout.list.js @@ -32,7 +32,9 @@ function resizeModalCanvas() { } function redrawPaths() { - if (!modalCoordSystem || !currentPathData) return; + if (!modalCoordSystem || !currentPathData) { + return; + } modalCoordSystem.clear(); @@ -68,7 +70,9 @@ function redrawPaths() { } function zoomIn(event) { - if (!modalCoordSystem) return; + if (!modalCoordSystem) { + return; + } const rect = modalCanvas.getBoundingClientRect(); let mouseX = rect.width / 2; let mouseY = rect.height / 2; @@ -78,7 +82,9 @@ function zoomIn(event) { } function zoomOut(event) { - if (!modalCoordSystem) return; + if (!modalCoordSystem) { + return; + } const rect = modalCanvas.getBoundingClientRect(); let mouseX = rect.width / 2; let mouseY = rect.height / 2; @@ -88,7 +94,9 @@ function zoomOut(event) { } function resetZoom() { - if (!modalCoordSystem) return; + if (!modalCoordSystem) { + return; + } modalCoordSystem.resetView(); redrawPaths(); } diff --git a/app/static/js/search.js b/app/static/js/search.js index f7e1aff..45132d2 100644 --- a/app/static/js/search.js +++ b/app/static/js/search.js @@ -44,7 +44,9 @@ function resizeModalCanvas() { } function redrawPaths() { - if (!modalCoordSystem || !currentPathData) return; + if (!modalCoordSystem || !currentPathData) { + return; + } modalCoordSystem.clear();