Skip to content

Commit

Permalink
Merge branch 'development' into countrypages
Browse files Browse the repository at this point in the history
  • Loading branch information
sd-ditoy committed Oct 24, 2023
2 parents b1efc50 + 1b0fc95 commit 91201d7
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 10 deletions.
81 changes: 72 additions & 9 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,96 @@ export default {
Footer,
CookieNotice,
},
//---------------------------------------------------
//
// Properties
//
//---------------------------------------------------
props: {},
//---------------------------------------------------
//
// Meta
//
//---------------------------------------------------
metaInfo: {
title: '',
titleTemplate: '%s | Casper Network',
},
watch: {
$route: {
handler(value) {
this.hash = value.hash || null;
},
},
},
//---------------------------------------------------
//
// Data model
//
//---------------------------------------------------
data() {
return {
hash: null,
samePage: false,
};
},
//---------------------------------------------------
//
// Computed Properties
//
//---------------------------------------------------
computed: {},
//---------------------------------------------------
//
// Watch Properties
//
//---------------------------------------------------
watch: {
$route: {
handler(newval, oldval) {
this.samePage = newval.path === oldval?.path;
this.hash = newval.hash || null;
},
},
},
//---------------------------------------------------
//
// Filter Properties
//
//---------------------------------------------------
// filters: {},
//---------------------------------------------------
//
// Validation Properties
//
//---------------------------------------------------
// validations: {},
//---------------------------------------------------
//
// Vue Lifecycle
//
//---------------------------------------------------
// beforeCreate() {},
// created() {},
// beforeMount() {},
// render(h) { return h(); },
// mounted() {},
// beforeUpdate() {},
updated() {
if (this.hash) {
this.$nextTick(() => {
const hash = this.hash.substr(1);
const { samePage } = this;
let { hash } = this;
hash = hash.substr(1);
const element = document.querySelector(`[data-slug='${hash}']`);
if (element) {
element.scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'center' });
const options = { behavior: 'smooth', block: 'center', inline: 'center' };
options.block = samePage ? 'start' : 'center';
element.scrollIntoView(options);
}
});
}
},
// beforeDestroy() {},
// destroyed() {},
//---------------------------------------------------
//
// Methods
//
//---------------------------------------------------
methods: {
handleManageCookies() {
this.$refs.cookieNotice.show();
Expand Down
2 changes: 1 addition & 1 deletion src/components/blocks/ResponsiveGallery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export default {
//---------------------------------------------------
computed: {
slugged() {
const title = (this.blockTitle || '').replace(/<\/?[^>]+(>|$)/g, '');
const title = (this.title || '').replace(/<\/?[^>]+(>|$)/g, '');
return slugify(title, { lower: true, strict: true });
},
computedItems() {
Expand Down

0 comments on commit 91201d7

Please sign in to comment.