changeset 2726:b68157126f41

Rename a function.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 07 Mar 2024 10:58:42 +0200
parents 7a0ec8693402
children 6683547af623
files src/citymap.js src/worldmap.js
diffstat 2 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/citymap.js	Thu Mar 07 10:35:05 2024 +0200
+++ b/src/citymap.js	Thu Mar 07 10:58:42 2024 +0200
@@ -13,7 +13,7 @@
 var mapCurrID;
 
 
-function mapFindElemCoords(elem)
+function mapGetElementCoords(elem)
 {
   var xc = yc = 0;
   if (elem.offsetParent)
@@ -170,7 +170,7 @@
   var nelem = document.getElementById('maploc'+eid);
   if (nelem)
   {
-    const pos = mapFindElemCoords(nelem);
+    const pos = mapGetElementCoords(nelem);
     mapDragPos.x = pos.x - (dim.w / 2);
     mapDragPos.y = pos.y - (dim.h / 2);
 
@@ -181,7 +181,7 @@
   nelem = document.getElementById('listloc'+eid);
   if (nelem)
   {
-    const pos = mapFindElemCoords(nelem);
+    const pos = mapGetElementCoords(nelem);
     listElem.scrollTop = pos.y - 10;
   }
 }
--- a/src/worldmap.js	Thu Mar 07 10:35:05 2024 +0200
+++ b/src/worldmap.js	Thu Mar 07 10:58:42 2024 +0200
@@ -19,7 +19,7 @@
 }
 
 
-function mapFindElemCoords(elem)
+function mapGetElementCoords(elem)
 {
   var xc = yc = 0;
   if (elem.offsetParent)
@@ -136,7 +136,7 @@
       mcelem.classList.add("nactive");
 
       mapCurrLoc = newLoc;
-      mapCurrPos = mapFindElemCoords(celem);
+      mapCurrPos = mapGetElementCoords(celem);
     }
   }
 
@@ -172,7 +172,7 @@
 
 function mapSetPosToElem(nelem)
 {
-  const pos = mapFindElemCoords(nelem);
+  const pos = mapGetElementCoords(nelem);
   mapSetWindowPos(pos.x, pos.y);
 }
 
@@ -200,9 +200,9 @@
         if (mapCurrPos != null)
           mapScrollPosStart = mapCurrPos;
         else
-          mapScrollPosStart = mapFindElemCoords(celem);
+          mapScrollPosStart = mapGetElementCoords(celem);
 
-        mapScrollPosEnd = mapFindElemCoords(nelem);
+        mapScrollPosEnd = mapGetElementCoords(nelem);
         mapScrollIndex = 0.0;
         mapScrollTimerID = setInterval(mapScrollToPos, 10);
       }