@everymatrix/casino-slider 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/casino-slider.js +1 -1
- package/dist/casino-slider.js.map +1 -1
- package/package.json +1 -1
- package/src/CasinoSlider.svelte +21 -22
package/package.json
CHANGED
package/src/CasinoSlider.svelte
CHANGED
@@ -81,26 +81,6 @@
|
|
81
81
|
}
|
82
82
|
}
|
83
83
|
|
84
|
-
const setClientStyling = ():void => {
|
85
|
-
let sheet = document.createElement('style');
|
86
|
-
sheet.innerHTML = clientstyling;
|
87
|
-
setTimeout(() => { customStylingContainer.appendChild(sheet); });
|
88
|
-
}
|
89
|
-
|
90
|
-
const setClientStylingURL = ():void => {
|
91
|
-
let cssFile = document.createElement('style');
|
92
|
-
let url:URL = new URL(clientstylingurl);
|
93
|
-
|
94
|
-
if (clientstylingurl) {
|
95
|
-
fetch(url.href)
|
96
|
-
.then((res:any) => res.text())
|
97
|
-
.then((data:any) => {
|
98
|
-
cssFile.innerHTML = data
|
99
|
-
setTimeout(() => { customStylingContainer.appendChild(cssFile); }, 1);
|
100
|
-
});
|
101
|
-
}
|
102
|
-
}
|
103
|
-
|
104
84
|
const messageHandler = (e:any):void => {
|
105
85
|
if (e.data.type == 'SliderData' && e.data.identity == identity) {
|
106
86
|
sliderdata = e.data.data;
|
@@ -173,6 +153,25 @@
|
|
173
153
|
});
|
174
154
|
}
|
175
155
|
|
156
|
+
const setClientStyling = ():void => {
|
157
|
+
let sheet = document.createElement('style');
|
158
|
+
sheet.innerHTML = clientstyling;
|
159
|
+
customStylingContainer.appendChild(sheet);
|
160
|
+
}
|
161
|
+
|
162
|
+
const setClientStylingURL = ():void => {
|
163
|
+
let cssFile = document.createElement('style');
|
164
|
+
let url:URL = new URL(clientstylingurl);
|
165
|
+
|
166
|
+
fetch(url.href)
|
167
|
+
.then((res:any) => res.text())
|
168
|
+
.then((data:any) => {
|
169
|
+
cssFile.innerHTML = data
|
170
|
+
|
171
|
+
setTimeout(() => { customStylingContainer.appendChild(cssFile); }, 1);
|
172
|
+
});
|
173
|
+
}
|
174
|
+
|
176
175
|
onMount(() => {
|
177
176
|
if ("ontouchstart" in document.documentElement) {
|
178
177
|
document.documentElement.className += " touch-device";
|
@@ -191,8 +190,8 @@
|
|
191
190
|
})
|
192
191
|
|
193
192
|
$: activeindex && setActiveIndex();
|
194
|
-
$: clientstyling && setClientStyling();
|
195
|
-
$: clientstylingurl && setClientStylingURL();
|
193
|
+
$: clientstyling && customStylingContainer && setClientStyling();
|
194
|
+
$: clientstylingurl && customStylingContainer && setClientStylingURL();
|
196
195
|
$: lang && setActiveLanguage();
|
197
196
|
</script>
|
198
197
|
|