From e53fc07dffca2a2ef3e929e120d4af6b41540cd7 Mon Sep 17 00:00:00 2001 From: Vladimir Kharlampidi Date: Sat, 8 Jul 2023 10:54:27 +0300 Subject: [PATCH] fix(element): fix in Safari < 16.4 fixes #6831 --- src/swiper-element.mjs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/swiper-element.mjs b/src/swiper-element.mjs index 27eb0ff4d..5d6dc3c35 100644 --- a/src/swiper-element.mjs +++ b/src/swiper-element.mjs @@ -13,7 +13,7 @@ import { updateSwiper } from './components-shared/update-swiper.mjs'; //SWIPER_STYLES //SWIPER_SLIDE_STYLES -class DummyHTMLElement { } +class DummyHTMLElement {} const ClassToExtend = typeof window === 'undefined' || typeof HTMLElement === 'undefined' @@ -24,7 +24,7 @@ const arrowSvg = ` { - if (typeof CSSStyleSheet !== 'undefined' && !shadowRoot.adoptedStyleSheets) { + if (typeof CSSStyleSheet !== 'undefined' && shadowRoot.adoptedStyleSheets) { const styleSheet = new CSSStyleSheet(); styleSheet.replaceSync(styles); shadowRoot.adoptedStyleSheets = [styleSheet]; @@ -32,9 +32,9 @@ const addStyle = (shadowRoot, styles) => { const style = document.createElement('style'); style.rel = 'stylesheet'; style.textContent = styles; - shadowRoot.appendChild(style) + shadowRoot.appendChild(style); } -} +}; class SwiperContainer extends ClassToExtend { constructor() { @@ -176,19 +176,19 @@ class SwiperContainer extends ClassToExtend { changedParams: [attrToProp(propName)], ...(propName === 'navigation' && passedParams[propName] ? { - prevEl: '.swiper-button-prev', - nextEl: '.swiper-button-next', - } + prevEl: '.swiper-button-prev', + nextEl: '.swiper-button-next', + } : {}), ...(propName === 'pagination' && passedParams[propName] ? { - paginationEl: '.swiper-pagination', - } + paginationEl: '.swiper-pagination', + } : {}), ...(propName === 'scrollbar' && passedParams[propName] ? { - scrollbarEl: '.swiper-scrollbar', - } + scrollbarEl: '.swiper-scrollbar', + } : {}), }); }