diff --git a/src/Spot.vue b/src/Spot.vue index 809084a..a69ba0c 100644 --- a/src/Spot.vue +++ b/src/Spot.vue @@ -78,7 +78,7 @@ export default { return {page: sPage, items: asHash}; }, setHash(sPage = '', asItems = []) { - if(typeof asItems == 'string') asItems = [asItems]; + if(typeof asItems == 'string' && asItems != '') asItems = [asItems]; const sItems = (asItems.length > 0)?(this.spot.consts.hash_sep + asItems.join(this.spot.consts.hash_sep)):''; window.location.hash = '#' + sPage + sItems; } diff --git a/src/components/project.vue b/src/components/project.vue index 997fd94..f376251 100644 --- a/src/components/project.vue +++ b/src/components/project.vue @@ -162,15 +162,15 @@ export default { resizeDuration: 400, hasVideo: true, onMediaChange: (oMedia) => { - this.spot.updateHash('media', oMedia.id); + this.$parent.hash.items = [this.currProject.codename, 'media', oMedia.id]; if(oMedia.set == 'post-medias') this.goToPost({type: 'media', id: oMedia.id}); }, - onClosing: () => {this.spot.flushHash();} + onClosing: () => {this.$parent.hash.items = [this.$parent.hash.items[0]];} }); }, async initFeed() { //Simplebar event - this.$refs.feedSimpleBar.scrollElement.addEventListener('scroll', this.onFeedScroll); + this.$refs.feedSimpleBar?.scrollElement.addEventListener('scroll', this.onFeedScroll); //Mobile Touchscreen Events //TODO @@ -622,7 +622,7 @@ export default { - parseFloat(getComputedStyle(this.$refs.feedSimpleBar.$el).paddingTop) ); - //this.spot.flushHash(['post', 'message']); + //this.$parent.hash.items = [this.$parent.hash.items[0]]; return oRef; } diff --git a/src/components/projectPost.vue b/src/components/projectPost.vue index a4de4a1..e3385d9 100644 --- a/src/components/projectPost.vue +++ b/src/components/projectPost.vue @@ -50,9 +50,8 @@ displayedId() { return this.options.displayed_id?(this.spot.lang('counter', this.options.displayed_id)):''; }, - hash() { - let asHash = this.spot.getHash(); - return '#'+[asHash.page, asHash.items[0], this.options.type, this.options.id].join(this.spot.consts.hash_sep); + anchorLink() { + return '#'+[this.hash.page, this.hash.items[0], this.options.type, this.options.id].join(this.spot.consts.hash_sep); }, modeHisto() { return (this.project.currProject.mode == this.spot.consts.modes.histo); @@ -69,10 +68,10 @@ } }, - inject: ['spot', 'project', 'user', 'map'], + inject: ['spot', 'project', 'user', 'map', 'hash'], methods: { copyAnchor() { - copyTextToClipboard(this.spot.consts.server+this.spot.hash()); + copyTextToClipboard(this.spot.consts.server+this.anchorLink); this.anchorTitle = this.spot.lang('link_copied'); this.anchorIcon = 'copied'; setTimeout(()=>{ //TODO animation @@ -141,7 +140,7 @@