@everymatrix/casino-filter-page 1.0.2 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/casino-filter-page",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "main": "dist/casino-filter-page.js",
5
5
  "svelte": "src/index.ts",
6
6
  "scripts": {
@@ -11,8 +11,8 @@
11
11
  export let lang:String = ''; // Language
12
12
  export let session:String = ''; // Value for sessionID
13
13
  export let userid:String = '';
14
- export let clientstyling:String = '';
15
- export let clientstylingurl:String = '';
14
+ export let clientstyling:string = '';
15
+ export let clientstylingurl:string = '';
16
16
 
17
17
  let vendorsArray:Array<Object> = [];
18
18
  let mobileView:Boolean = false;
@@ -252,23 +252,23 @@
252
252
  window.postMessage({ type: "ApplyFilters"}, window.location.href);
253
253
  }
254
254
 
255
- const setClientStyling = () => {
255
+ const setClientStyling = ():void => {
256
256
  let sheet = document.createElement('style');
257
-
258
257
  sheet.innerHTML = clientstyling;
259
258
  customStylingContainer.appendChild(sheet);
260
259
  }
261
260
 
262
- const setClientStylingURL = () => {
261
+ const setClientStylingURL = ():void => {
262
+ let url:URL = new URL(clientstylingurl);
263
263
  let cssFile:HTMLElement = document.createElement('style');
264
264
 
265
- fetch(new URL(clientstylingurl))
265
+ fetch(url.href)
266
266
  .then((res:any) => res.text())
267
267
  .then((data:any) => {
268
268
  cssFile.innerHTML = data
269
269
 
270
270
  if (customStylingContainer) {
271
- setTimeout(() => { customStylingContainer.appendChild(cssFile); }, 1);
271
+ setTimeout(() => { customStylingContainer.appendChild(cssFile) }, 1);
272
272
  }
273
273
  });
274
274
  }
@@ -285,8 +285,8 @@
285
285
  }
286
286
  });
287
287
 
288
- $: clientstyling && setClientStyling();
289
- $: clientstylingurl && setClientStylingURL();
288
+ $: clientstyling && customStylingContainer && setClientStyling();
289
+ $: clientstylingurl && customStylingContainer && setClientStylingURL();
290
290
  </script>
291
291
 
292
292
  <div bind:this={customStylingContainer} part="CustomStylingContainer">