From 88afdf90e567a33a6e6b6d92a30729682f0600d5 Mon Sep 17 00:00:00 2001 From: Sebastian Schreier Date: Wed, 6 Sep 2023 18:29:23 +0200 Subject: [PATCH] established the compatibility with Shopware from version 6.5 --- composer.json | 6 +++--- .../storefront/dist/storefront/js/sschreier-sticky-menu.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index d53fa92..45260a8 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "sschreier/sschreierstickymenu", "description": "Sticky MenĂ¼", - "version": "1.0.3", + "version": "1.1.0", "type": "shopware-platform-plugin", "license": "proprietary", "authors": [ @@ -11,8 +11,8 @@ } ], "require": { - "shopware/core": "~6.4.18", - "shopware/storefront": "~6.4.18" + "shopware/core": "~6.5.0", + "shopware/storefront": "~6.5.0" }, "extra": { "shopware-plugin-class": "Sschreier\\StickyMenu\\SschreierStickyMenu", diff --git a/src/Resources/app/storefront/dist/storefront/js/sschreier-sticky-menu.js b/src/Resources/app/storefront/dist/storefront/js/sschreier-sticky-menu.js index 060d045..5269d54 100644 --- a/src/Resources/app/storefront/dist/storefront/js/sschreier-sticky-menu.js +++ b/src/Resources/app/storefront/dist/storefront/js/sschreier-sticky-menu.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([["sschreier-sticky-menu"],{FUb4:function(i,e,t){"use strict";t.r(e);var n=t("FGIj"),o=t("gHbT"),r=t("nnsc");function a(i){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(i){return typeof i}:function(i){return i&&"function"==typeof Symbol&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i})(i)}function s(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function u(i,e){for(var t=0;tthis.options.positionStickyMenuIsActive?this._mainNavigationClone.classList.contains("is--active")||this._mainNavigationClone.classList.add("is--active"):this._mainNavigationClone.classList.remove("is--active")}},{key:"reinitializePlugin",value:function(){this.PluginManager.initializePlugin("FlyoutMenu",'[data-flyout-menu="true"]',{})}},{key:"subscribeViewportEvent",value:function(){document.$emitter.subscribe("Viewport/hasChanged",this.update,{scope:this})}},{key:"update",value:function(){if(this.pluginShouldBeActive()){if(this.initialized)return;this.initializePlugin()}else{if(!this.initialized)return;this.destroy()}}},{key:"pluginShouldBeActive",value:function(){return!this.options.notActiveViewportsStickyMenu.includes(r.a.getCurrentViewport())}},{key:"initializePlugin",value:function(){this.createElement(),this.addEventListener(),this.reinitializePlugin(),this.initialized=!0}},{key:"destroy",value:function(){this._mainNavigationClone.remove(),this.removeEventListener(),this.initialized=!1}}])&&u(t.prototype,n),a&&u(t,a),e}(n.a);y={cloneMainNavigationStickyClass:"main-navigation-sticky",positionStickyMenuIsActive:120,notActiveViewportsStickyMenu:"'XS', 'SM', 'MD'"},(p="options")in(f=h)?Object.defineProperty(f,p,{value:y,enumerable:!0,configurable:!0,writable:!0}):f[p]=y,window.PluginManager.register("StickyMenuPlugin",h,"[data-sticky-menu]",{positionStickyMenuIsActive:120,notActiveViewportsStickyMenu:"'XS', 'SM', 'MD'"})}},[["FUb4","runtime","vendor-node","vendor-shared"]]]); \ No newline at end of file +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([["sschreier-sticky-menu"],{9057:(i,t,e)=>{var n,s,o,a=e(6285),r=e(3206),l=e(7474);class u extends a.Z{init(){this.PluginManager=window.PluginManager,this.subscribeViewportEvent(),this.pluginShouldBeActive()&&this.initializePlugin()}createElement(){this._mainNavigationClone=this.el.cloneNode(!0),this._mainNavigationClone.classList.add(this.options.cloneMainNavigationStickyClass),r.Z.querySelector(this._mainNavigationClone,".main-navigation").removeAttribute("id"),document.body.appendChild(this._mainNavigationClone)}addEventListener(){document.addEventListener("scroll",this.onScroll.bind(this))}removeEventListener(){document.removeEventListener("scroll",this.onScroll.bind(this))}onScroll(){document.documentElement.scrollTop>this.options.positionStickyMenuIsActive?this._mainNavigationClone.classList.contains("is--active")||this._mainNavigationClone.classList.add("is--active"):this._mainNavigationClone.classList.remove("is--active")}reinitializePlugin(){this.PluginManager.initializePlugin("FlyoutMenu",'[data-flyout-menu="true"]',{})}subscribeViewportEvent(){document.$emitter.subscribe("Viewport/hasChanged",this.update,{scope:this})}update(){if(this.pluginShouldBeActive()){if(this.initialized)return;this.initializePlugin()}else{if(!this.initialized)return;this.destroy()}}pluginShouldBeActive(){return!this.options.notActiveViewportsStickyMenu.includes(l.Z.getCurrentViewport())}initializePlugin(){this.createElement(),this.addEventListener(),this.reinitializePlugin(),this.initialized=!0}destroy(){this._mainNavigationClone.remove(),this.removeEventListener(),this.initialized=!1}}n=u,o={cloneMainNavigationStickyClass:"main-navigation-sticky",positionStickyMenuIsActive:120,notActiveViewportsStickyMenu:"'XS', 'SM', 'MD'"},(s=function(i){var t=function(i,t){if("object"!=typeof i||null===i)return i;var e=i[Symbol.toPrimitive];if(void 0!==e){var n=e.call(i,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(i)}(i,"string");return"symbol"==typeof t?t:String(t)}(s="options"))in n?Object.defineProperty(n,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[s]=o;window.PluginManager.register("StickyMenuPlugin",u,"[data-sticky-menu]",{positionStickyMenuIsActive:120,notActiveViewportsStickyMenu:"'XS', 'SM', 'MD'"})}},i=>{i.O(0,["vendor-node","vendor-shared"],(()=>{return t=9057,i(i.s=t);var t}));i.O()}]); \ No newline at end of file