From 0442456eb3f03f2c5dfa51013337313bb5649736 Mon Sep 17 00:00:00 2001 From: Martin Ficzel Date: Wed, 19 Jan 2022 17:36:45 +0100 Subject: [PATCH] TASK: Remove alpine js in favor of splitted js submodules --- .../Block/ScrollToTop/ScrollToTop.alpine.ts | 26 ------------------- .../Block/ScrollToTop/ScrollToTop.entry.ts | 3 +++ .../Block/ScrollToTop/ScrollToTop.fusion | 6 ++--- .../Fusion/Resource/BodyScripts.fusion | 2 -- 4 files changed, 6 insertions(+), 31 deletions(-) delete mode 100644 DistributionPackages/Vendor.WheelInventor/Resources/Private/Fusion/Presentation/Block/ScrollToTop/ScrollToTop.alpine.ts create mode 100644 DistributionPackages/Vendor.WheelInventor/Resources/Private/Fusion/Presentation/Block/ScrollToTop/ScrollToTop.entry.ts diff --git a/DistributionPackages/Vendor.WheelInventor/Resources/Private/Fusion/Presentation/Block/ScrollToTop/ScrollToTop.alpine.ts b/DistributionPackages/Vendor.WheelInventor/Resources/Private/Fusion/Presentation/Block/ScrollToTop/ScrollToTop.alpine.ts deleted file mode 100644 index 5bc4cc6..0000000 --- a/DistributionPackages/Vendor.WheelInventor/Resources/Private/Fusion/Presentation/Block/ScrollToTop/ScrollToTop.alpine.ts +++ /dev/null @@ -1,26 +0,0 @@ -function ScrollToTop() { - return { - button: { - 'x-on:scroll.window'() { - this.visible = window.scrollY > 0; - }, - - 'x-bind:class'() { - return { - 'opacity-100': this.visible, - 'opacity-0 pointer-events-none': !this.visible - }; - }, - - 'x-on:click'() { - window.scroll({ - top: 0, - behavior: 'smooth' - }); - }, - } as any, - visible: window.scrollY > 0 - }; -} - -Object.assign(window, {ScrollToTop}); diff --git a/DistributionPackages/Vendor.WheelInventor/Resources/Private/Fusion/Presentation/Block/ScrollToTop/ScrollToTop.entry.ts b/DistributionPackages/Vendor.WheelInventor/Resources/Private/Fusion/Presentation/Block/ScrollToTop/ScrollToTop.entry.ts new file mode 100644 index 0000000..d16ee16 --- /dev/null +++ b/DistributionPackages/Vendor.WheelInventor/Resources/Private/Fusion/Presentation/Block/ScrollToTop/ScrollToTop.entry.ts @@ -0,0 +1,3 @@ +export default (el: HTMLElement): void => { + el.addEventListener("click", (e) => (console.log("to implement"))); +}; diff --git a/DistributionPackages/Vendor.WheelInventor/Resources/Private/Fusion/Presentation/Block/ScrollToTop/ScrollToTop.fusion b/DistributionPackages/Vendor.WheelInventor/Resources/Private/Fusion/Presentation/Block/ScrollToTop/ScrollToTop.fusion index c5fde05..66d2c1e 100644 --- a/DistributionPackages/Vendor.WheelInventor/Resources/Private/Fusion/Presentation/Block/ScrollToTop/ScrollToTop.fusion +++ b/DistributionPackages/Vendor.WheelInventor/Resources/Private/Fusion/Presentation/Block/ScrollToTop/ScrollToTop.fusion @@ -15,17 +15,17 @@ prototype(Vendor.WheelInventor:Block.ScrollToTop) < prototype(Neos.Fusion:Compon @propTypes { id = ${PropTypes.string.isRequired} title = ${PropTypes.string.isRequired} + content = ${PropTypes.string.isRequired} } renderer = afx` ` } diff --git a/DistributionPackages/Vendor.WheelInventor/Resources/Private/Fusion/Resource/BodyScripts.fusion b/DistributionPackages/Vendor.WheelInventor/Resources/Private/Fusion/Resource/BodyScripts.fusion index ec796d0..cf07fe8 100644 --- a/DistributionPackages/Vendor.WheelInventor/Resources/Private/Fusion/Resource/BodyScripts.fusion +++ b/DistributionPackages/Vendor.WheelInventor/Resources/Private/Fusion/Resource/BodyScripts.fusion @@ -13,6 +13,4 @@ prototype(Vendor.WheelInventor:Resource.BodyScripts) < prototype(Neos.Fusion:Arr @process.addCacheBuster = ${value + '?cb=' + SitegeistKlarSchiffCacheBuster.get()} } } - - alpine = '' }