# HG changeset patch # User Matti Hamalainen # Date 1709801922 -7200 # Node ID b68157126f41ef35fb4c36381e2d507d4d4fe5e2 # Parent 7a0ec8693402fdfa29b5cf935eacb278b4fa30e3 Rename a function. diff -r 7a0ec8693402 -r b68157126f41 src/citymap.js --- 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; } } diff -r 7a0ec8693402 -r b68157126f41 src/worldmap.js --- 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); }