@everymatrix/casino-lobby 1.7.3 → 1.8.3

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-lobby",
3
- "version": "1.7.3",
3
+ "version": "1.8.3",
4
4
  "main": "dist/casino-lobby.js",
5
5
  "svelte": "src/index.ts",
6
6
  "scripts": {
@@ -36,5 +36,5 @@
36
36
  "publishConfig": {
37
37
  "access": "public"
38
38
  },
39
- "gitHead": "af607736d2fefc2fcb0fc155b2023fcd62806a5c"
39
+ "gitHead": "15df0a4bc1195017b7df65675dfd40261b5dbe8b"
40
40
  }
@@ -115,6 +115,7 @@
115
115
  let playerID:string = '';
116
116
  let userAgent:string = window.navigator.userAgent;
117
117
  let isLoading:boolean = true;
118
+ let searchClosed:boolean = false;
118
119
 
119
120
  let headerPlaceholderSize:number = 0;
120
121
  let scrollTop:boolean = false;
@@ -128,6 +129,10 @@
128
129
  const messageHandler = (e:any):void => {
129
130
  if (e.data) {
130
131
  switch(e.data.type) {
132
+ case 'searchCancelled':
133
+ searchClosed = true;
134
+ break;
135
+
131
136
  case 'WidgetTopReference':
132
137
  scrollTop = e.data.scrollTop;
133
138
  // check if the category has been changed and the scroll top
@@ -135,7 +140,9 @@
135
140
  if (!headerPlaceholderSize) {
136
141
  headerPlaceholderSize = (getDevice(userAgent) === 'PC') ? parseInt(desktopoffset) : parseInt(mobileoffset);
137
142
  }
138
- window.scrollTo({ top: headerPlaceholderSize });
143
+ // do not scroll if the casino page was changed because searchInput was closed
144
+ !searchClosed && window.scrollTo({ top: headerPlaceholderSize });
145
+ searchClosed = false;
139
146
  }
140
147
  break;
141
148