Better hash management
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user