Better hash management

This commit is contained in:
2026-04-25 17:44:46 +02:00
parent c32998650f
commit dea14acd29
4 changed files with 31 additions and 26 deletions
+9 -9
View File
@@ -91,7 +91,7 @@ export default {
},
inject: ['spot', 'hash', 'projects', 'user'],
beforeMount() {
if(this.$parent.hash.items.length == 0) this.$parent.hash.items[0] = this.spot.vars('default_project_codename');
if(this.hash.items.length == 0) this.hash.items[0] = this.spot.vars('default_project_codename');
},
mounted() {
this.spot.addPage('project', {
@@ -110,7 +110,7 @@ export default {
//Check for project change
if(asNewHash.items[0] != asOldHash.items[0]) {
this.$parent.hash.items = [asNewHash.items[0]];
this.hash.items = [asNewHash.items[0]];
this.init();
}
},
@@ -136,7 +136,7 @@ export default {
]);
//Direct link: Scroll to post
if(this.$parent.hash.items.length == 3) this.findPost({type: this.$parent.hash.items[1], id: this.$parent.hash.items[2]});
if(this.hash.items.length == 3) this.findPost({type: this.hash.items[1], id: this.hash.items[2]});
},
quit() {
lightbox.end();
@@ -145,7 +145,7 @@ export default {
this.map.remove();
},
initProject() {
this.currProject = this.projects[this.$parent.hash.items[0]];
this.currProject = this.projects[this.hash.items[0]];
this.modeHisto = (this.currProject.mode == this.spot.consts.modes.histo);
this.feed = {loading:false, updatable:true, outOfData:false, refIdFirst:0, refIdLast:0, firstChunk:true};
this.posts = [];
@@ -162,10 +162,10 @@ export default {
resizeDuration: 400,
hasVideo: true,
onMediaChange: (oMedia) => {
this.$parent.hash.items = [this.currProject.codename, 'media', oMedia.id];
this.hash.items = [this.currProject.codename, 'media', oMedia.id];
if(oMedia.set == 'post-medias') this.goToPost({type: 'media', id: oMedia.id});
},
onClosing: () => {this.$parent.hash.items = [this.$parent.hash.items[0]];}
onClosing: () => {this.hash.items = [this.hash.items[0]];}
});
},
async initFeed() {
@@ -332,7 +332,7 @@ export default {
if( //Blog Mode: Fit to last message
this.currProject.mode == this.spot.consts.modes.blog &&
this.markers.messages.length > 0 &&
this.$parent.hash.items[2] != 'message'
this.hash.items[2] != 'message'
) {
let oLastMsg = this.markers.messages[this.markers.messages.length - 1];
@@ -622,7 +622,7 @@ export default {
- parseFloat(getComputedStyle(this.$refs.feedSimpleBar.$el).paddingTop)
);
//this.$parent.hash.items = [this.$parent.hash.items[0]];
//this.hash.items = [this.hash.items[0]];
return oRef;
}
@@ -725,4 +725,4 @@ export default {
</div>
</div>
</div>
</template>
</template>
+3 -2
View File
@@ -87,6 +87,7 @@
this.focusZoomLevel,
() => {this.map.openMarkerPopup(this.options.id_message);}
);
this.hash.items = [this.hash.items[0], this.options.type, this.options.id_message];
},
openMarkerPopup() {
if(this.map.isMarkerVisible(this.lngLat)) this.map.openMarkerPopup(this.options.id_message);
@@ -160,7 +161,7 @@
<p v-if="timeDiff">
<projectRelTime :icon="'time'" :iconClasses="'push'" :localTime="absTimeLocal" :siteTime="options.formatted_time" :offset="options.day_offset" />
</p>
<a class="drill" @click.prevent="panMapToMessage">
<a class="drill" @click.prevent="executeMainAction">
<span v-if="options.weather_icon && options.weather_icon!='unknown'" class="weather clickable" :title="spot.lang(options.weather_cond)">
<spotIcon :icon="options.weather_icon" />
<span class="temperature">{{ options.weather_temp+'°C' }}</span>
@@ -194,4 +195,4 @@
</div>
</div>
</div>
</template>
</template>