From 2ef2948a6e4bf2cbe32d547d18a5f7dacbf77397 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Thu, 25 Sep 2025 16:02:43 +0200 Subject: [PATCH] prevent strange effects when switching between content_types --- public/js/components/Cis/Cms/Content.js | 32 ++++--------------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/public/js/components/Cis/Cms/Content.js b/public/js/components/Cis/Cms/Content.js index ec1bc8a76..355add08a 100644 --- a/public/js/components/Cis/Cms/Content.js +++ b/public/js/components/Cis/Cms/Content.js @@ -30,39 +30,19 @@ export default { }, data() { return { + content_type: null, content: null, content_id_internal: this.content_id }; }, methods: { fetchContent(){ - return this.$api + this.$api .call(ApiCms.content(this.content_id_internal, this.version, this.sprache, this.sichtbar)) .then(res => { - this.content = res.data.content; - this.content_type = res.data.type; - - document.querySelectorAll("#cms [data-confirm]").forEach((el) => { - el.addEventListener("click", (evt) => { - evt.preventDefault(); - BsConfirm.popup(el.dataset.confirm) - .then(() => { - Axios.get(el.href) - .then((res) => { - // TODO(chris): check for success then show message and/or reload - location = location; - }) - .catch((err) => console.error("ERROR:", err)); - }) - .catch(() => { - }); - }); - }); - document.querySelectorAll("#cms [data-href]").forEach((el) => { - el.href = el.dataset.href.replace( - /^ROOT\//, - FHC_JS_DATA_STORAGE_OBJECT.app_root - ); + this.$nextTick(function() { + this.content = res.data.content; + this.content_type = res.data.type; }); }); } @@ -96,8 +76,6 @@ export default { created() { this.fetchContent(); }, - mounted() { - }, template: /*html*/ `