ctucx.git: trainsearch

web based trip-planner, fork of https://cyberchaos.dev/yuka/trainsearch

commit 494f07e4c5e7581c0629305c3f405fb05fd067e9
parent d690d6a14f5eb6ca9dbade78f0234684a9c68c2f
Author: Katja (ctucx) <git@ctu.cx>
Date: Wed, 5 Feb 2025 10:16:40 +0100

journeyView: swap more/refresh
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/assets/style.css b/src/assets/style.css
@@ -105,7 +105,7 @@ a {
 			margin-right: 1.5em;
 		}
 
-		.icon-dots {
+		.icon-reload {
 			float: right;
 		}
 
diff --git a/src/journeyView.js b/src/journeyView.js
@@ -130,11 +130,11 @@ const journeyTemplate = (data, profile) => {
 			<header>
 				${data.slug ? html`<a class="icon-back" href="#/${data.slug}/${settings.journeysViewMode}" title="${t('back')}"></a>` : nothing}
 				<div class="container">
-					<a class="icon-dots" title="${t("more")}" @click=${() => moreOverlay()}></a>
+					<a class="icon-reload" title="${t("reload")}" @click=${() => refreshJourneyView(profile, data.refreshToken)}></a>
 					<h3>${formatName(data.legs[0].origin)} → ${formatName(data.legs[data.legs.length - 1].destination)}</h3>
 					<p><b>${t('duration')}: ${formatDuration(duration)} | ${t('changes')}: ${changes-1} | ${t('date')}: ${formatDateTime(data.legs[0].plannedDeparture, 'date')}${settings.showPrices && settings.profile === 'db' && data.price ? html` | ${t('price')}: <td><span>${formatPrice(data.price)}</span></td>` : nothing}</b></p>
 				</div>
-				<a class="icon-reload" title="${t("reload")}" @click=${() => refreshJourneyView(data.refreshToken, profile)}></a>
+				<a class="icon-dots" title="${t("more")}" @click=${() => moreModal(profile, data.refreshToken)}></a>
 			</header>
 		</div>
 

@@ -185,7 +185,7 @@ export const journeyView = async (match, isUpdate) => {
 	setThemeColor(queryBackgroundColor('header'));
 };
 
-const refreshJourneyView = async (refreshToken, profile) => {
+const refreshJourneyView = async (profile, refreshToken) => {
 	document.querySelector('.icon-reload').classList.add('spinning');
 
 	try {

@@ -200,7 +200,7 @@ const refreshJourneyView = async (refreshToken, profile) => {
 	document.querySelector('.icon-reload').classList.remove('spinning');
 };
 
-const moreOverlay = () => {
+const moreModal = (profile, refreshToken) => {
 	const options = [
 		{ 'label': !navigator.canShare ? t('copyURL') : t('shareURL'), 'action': () => { shareAction(); hideOverlay(); }},
 	];

@@ -216,4 +216,5 @@ const shareAction = async () => {
 	} catch (error) {
 		navigator.clipboard.writeText(window.location);
 	}
-};-
\ No newline at end of file
+};
+