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: {},
width: 4
},
popup: {content: null, element: null}
popup: {content: null, element: null},
overview: {id: 0, codename:'overview', name: this.lang.get('project.overview')}
};
},
computed: {
@@ -57,7 +58,7 @@ export default {
},
projectOptions() {
return [
{id: 'overview', codename: '', name: this.lang.get('project.overview')},
this.overview,
...Object.values(this.projects)
];
}
@@ -71,7 +72,7 @@ export default {
},
'hash.items.0'(newProjectCodename, oldProjectCodename) {
if(newProjectCodename != oldProjectCodename) {
this.hash.items = newProjectCodename?[newProjectCodename]:[];
this.hash.items = [newProjectCodename];
this.toggleSettingsPanel(false, 'none');
this.init();
}
@@ -90,7 +91,9 @@ export default {
},
inject: ['api', 'lang', 'hash', 'projects', 'user', 'consts', 'isMobile'],
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() {
this.init();
@@ -107,7 +110,7 @@ export default {
'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();
},
quit() {
@@ -117,6 +120,7 @@ export default {
this.map.remove();
},
async initProjectOverview() {
this.hash.items = [this.overview.codename];
this.setFeedUpdateTimer(-1);
this.currProject = null;
this.modeHisto = null;
@@ -126,9 +130,9 @@ export default {
await this.initMapOverview();
},
async initProject() {
async initProject(iProjectId) {
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.feed = {loading:false, updatable:true, outOfData:false, refIdFirst:0, refIdLast:0, firstChunk:true};
this.posts = [];
@@ -640,7 +644,7 @@ export default {
<h1><SpotIcon :icon="'project'" width="fixed" :text="lang.get('project.hikes')" /></h1>
<div class="settings-section-body">
<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">
<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="()=>{}">