pre select "overview" radio button by default
All checks were successful
Deploy Spot / deploy (push) Successful in 37s

This commit is contained in:
2026-05-19 14:44:40 +02:00
parent 39ddd1cf95
commit 93a72c628e

View File

@@ -45,7 +45,8 @@ export default {
colors: {}, colors: {},
width: 4 width: 4
}, },
popup: {content: null, element: null} popup: {content: null, element: null},
overview: {id: 0, codename:'overview', name: this.lang.get('project.overview')}
}; };
}, },
computed: { computed: {
@@ -57,7 +58,7 @@ export default {
}, },
projectOptions() { projectOptions() {
return [ return [
{id: 'overview', codename: '', name: this.lang.get('project.overview')}, this.overview,
...Object.values(this.projects) ...Object.values(this.projects)
]; ];
} }
@@ -71,7 +72,7 @@ export default {
}, },
'hash.items.0'(newProjectCodename, oldProjectCodename) { 'hash.items.0'(newProjectCodename, oldProjectCodename) {
if(newProjectCodename != oldProjectCodename) { if(newProjectCodename != oldProjectCodename) {
this.hash.items = newProjectCodename?[newProjectCodename]:[]; this.hash.items = [newProjectCodename];
this.toggleSettingsPanel(false, 'none'); this.toggleSettingsPanel(false, 'none');
this.init(); this.init();
} }
@@ -90,7 +91,9 @@ export default {
}, },
inject: ['api', 'lang', 'hash', 'projects', 'user', 'consts', 'isMobile'], inject: ['api', 'lang', 'hash', 'projects', 'user', 'consts', 'isMobile'],
beforeMount() { beforeMount() {
if(this.hash.items.length == 0 && this.projects.getDefaultProject().mode == this.consts.modes.blog) this.hash.items[0] = this.projects.getDefaultCodeName(); if(this.hash.items.length == 0) {
this.hash.items[0] = (this.projects.getDefaultProject().mode == this.consts.modes.blog)?this.projects.getDefaultCodeName():this.overview.codename;
}
}, },
mounted() { mounted() {
this.init(); this.init();
@@ -107,7 +110,7 @@ export default {
'hitchhiking': this.getStyleProperty('--track-hitchhiking') 'hitchhiking': this.getStyleProperty('--track-hitchhiking')
}; };
if(this.hash.items[0] && this.projects[this.hash.items[0]]) await this.initProject(); if(this.hash.items[0] && this.projects[this.hash.items[0]]) await this.initProject(this.hash.items[0]);
else await this.initProjectOverview(); else await this.initProjectOverview();
}, },
quit() { quit() {
@@ -117,6 +120,7 @@ export default {
this.map.remove(); this.map.remove();
}, },
async initProjectOverview() { async initProjectOverview() {
this.hash.items = [this.overview.codename];
this.setFeedUpdateTimer(-1); this.setFeedUpdateTimer(-1);
this.currProject = null; this.currProject = null;
this.modeHisto = null; this.modeHisto = null;
@@ -126,9 +130,9 @@ export default {
await this.initMapOverview(); await this.initMapOverview();
}, },
async initProject() { async initProject(iProjectId) {
this.setFeedUpdateTimer(-1); this.setFeedUpdateTimer(-1);
this.currProject = this.projects[this.hash.items[0]]; this.currProject = this.projects[iProjectId];
this.modeHisto = (this.currProject.mode == this.consts.modes.histo); this.modeHisto = (this.currProject.mode == this.consts.modes.histo);
this.feed = {loading:false, updatable:true, outOfData:false, refIdFirst:0, refIdLast:0, firstChunk:true}; this.feed = {loading:false, updatable:true, outOfData:false, refIdFirst:0, refIdLast:0, firstChunk:true};
this.posts = []; this.posts = [];
@@ -640,7 +644,7 @@ export default {
<h1><SpotIcon :icon="'project'" width="fixed" :text="lang.get('project.hikes')" /></h1> <h1><SpotIcon :icon="'project'" width="fixed" :text="lang.get('project.hikes')" /></h1>
<div class="settings-section-body"> <div class="settings-section-body">
<div class="radio" v-for="project in projectOptions" :key="'project-'+project.id"> <div class="radio" v-for="project in projectOptions" :key="'project-'+project.id">
<input type="radio" :id="'project-'+project.id" :value="project.codename" v-model="$parent.hash.items[0]" /> <input type="radio" :id="'project-'+project.id" :value="project.codename" v-model="hash.items[0]" />
<label :for="'project-'+project.id"> <label :for="'project-'+project.id">
<span>{{ project.name }}</span> <span>{{ project.name }}</span>
<a v-if="project.gpxfilepath" class="download" :href="project.gpxfilepath" :download="project.codename + '.gpx'" :title="lang.get('track.download')" @click.stop="()=>{}"> <a v-if="project.gpxfilepath" class="download" :href="project.gpxfilepath" :download="project.codename + '.gpx'" :title="lang.get('track.download')" @click.stop="()=>{}">