From fb2bfc292485ecd4155f04e2ff48852e20756cdf Mon Sep 17 00:00:00 2001 From: f4ilji Date: Thu, 9 Jan 2025 13:26:14 +0500 Subject: [PATCH] Changes --- .../Pages/Blocks/PageResourceList.vue | 43 +++++++++++++++---- resources/js/mixins/LinksReform.js | 30 ++++++------- 2 files changed, 50 insertions(+), 23 deletions(-) diff --git a/resources/js/Components/BuilderUi/Pages/Blocks/PageResourceList.vue b/resources/js/Components/BuilderUi/Pages/Blocks/PageResourceList.vue index ec828b6..6c61559 100644 --- a/resources/js/Components/BuilderUi/Pages/Blocks/PageResourceList.vue +++ b/resources/js/Components/BuilderUi/Pages/Blocks/PageResourceList.vue @@ -35,23 +35,42 @@ -
+
- +
- Blog Image -
+ Blog Image +
-
-

{{ item.model_select }}

-

{{ item.title }}

-

{{ item.link_text }}

+
+ +

+ {{ textLimit(item.title, 40) }} +

+

+ {{ item.link_text }} +

+ +
@@ -93,6 +112,14 @@ export default { randomBgClass() { return this.colors[Math.floor(Math.random() * this.colors.length)]; }, + textLimit(text, symbols) { + if (text.length > symbols) { + let LimitedText; + LimitedText = text.substring(0, symbols); + return LimitedText + "..."; + } + return text; + }, }, mounted() { const id = this.block?.data.resource || this.resourceId diff --git a/resources/js/mixins/LinksReform.js b/resources/js/mixins/LinksReform.js index 7bcc104..90b5e33 100644 --- a/resources/js/mixins/LinksReform.js +++ b/resources/js/mixins/LinksReform.js @@ -29,20 +29,20 @@ export const linksReform = { this.clearBodyStyles(); - // const hostname = window.location.hostname; - // const defaultLinks = Array.from(this.getDefaultLinks()); - // - // const reactiveLinks = this.createReactiveLinks(defaultLinks, hostname); - // - // reactiveLinks.forEach(link => { - // link.addEventListener('click', (event) => { - // event.preventDefault(); - // this.clearBodyStyles(); - // const url = link.getAttribute('href'); - // this.$inertia.visit(url, { - // preserveScroll: false, - // }); - // }); - // }); + const hostname = window.location.hostname; + const defaultLinks = Array.from(this.getDefaultLinks()); + + const reactiveLinks = this.createReactiveLinks(defaultLinks, hostname); + + reactiveLinks.forEach(link => { + link.addEventListener('click', (event) => { + event.preventDefault(); + this.clearBodyStyles(); + const url = link.getAttribute('href'); + this.$inertia.visit(url, { + preserveScroll: false, + }); + }); + }); } }; \ No newline at end of file