From d0797bebc993d66e83baecf7c25ec7bf4115cbb9 Mon Sep 17 00:00:00 2001 From: Noah Lancien Date: Mon, 12 Jun 2023 09:53:07 +0200 Subject: [PATCH] Fixed ImageInputComponent --- .../ts/bo/components/ImageInputComponent.vue | 12 +++++++---- resources/ts/modules/bsTooltips.ts | 20 ++++++++++++++----- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/resources/ts/bo/components/ImageInputComponent.vue b/resources/ts/bo/components/ImageInputComponent.vue index 88355eb..f48cef6 100644 --- a/resources/ts/bo/components/ImageInputComponent.vue +++ b/resources/ts/bo/components/ImageInputComponent.vue @@ -34,7 +34,7 @@ class="d-none" :name="inTname" type="text" - :value="inTvalue" + :value="submitIntValue" > { this.inTvalue = value.replace(/^\/|^/, "/"); - this.inTvalueFileName = value; + this.inTvalueFileName = value.replace(/^\/|^/, ""); fetch(this.inTvalue) .then((response) => { self.inToriginalFileName = response.url.substring( diff --git a/resources/ts/modules/bsTooltips.ts b/resources/ts/modules/bsTooltips.ts index e660390..06dec98 100644 --- a/resources/ts/modules/bsTooltips.ts +++ b/resources/ts/modules/bsTooltips.ts @@ -1,16 +1,26 @@ import type * as bootstrap from "bootstrap"; +/** ! Ignore here because there is no good TS vue mixin implementation at this time */ export default { + data(): { + _tooltips: Array; + } { + return { + _tooltips: [], + }; + }, methods: { - tooltips: [] as Array, - initTooltips(): void { - if (this.tooltips) { - this.tooltips.forEach((tooltip) => { + initTooltips() { + // @ts-ignore + if (this._tooltips) { + // @ts-ignore + this._tooltips.forEach((tooltip) => { tooltip.disable(); tooltip.hide(); }); } - this.tooltips = [].slice + // @ts-ignore + this._tooltips = [].slice .call(document.querySelectorAll("[data-bs-toggle=\"tooltip\"]")) .map(function (tooltipTriggerEl) { return new window.bootstrap.Tooltip(tooltipTriggerEl, {