@hkdigital/lib-core 0.5.33 → 0.5.35
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.
|
@@ -240,26 +240,37 @@
|
|
|
240
240
|
|
|
241
241
|
function updateIosWidthHeight() {
|
|
242
242
|
if (isPwa && isAppleMobile) {
|
|
243
|
-
const angle = screen.orientation.angle;
|
|
244
|
-
|
|
245
|
-
//
|
|
246
|
-
|
|
247
|
-
|
|
243
|
+
// const angle = screen.orientation.angle;
|
|
244
|
+
// if( window.matchMedia('(orientation: portrait)').matches ) {
|
|
245
|
+
// }
|
|
246
|
+
|
|
247
|
+
switch( screen.orientation.type ) {
|
|
248
|
+
case "portrait-primary":
|
|
249
|
+
case "portrait-secondary":
|
|
250
|
+
isLandscape = false;
|
|
251
|
+
break;
|
|
252
|
+
default:
|
|
253
|
+
isLandscape = true;
|
|
254
|
+
break;
|
|
255
|
+
}
|
|
248
256
|
|
|
249
257
|
// Use window.inner dimensions instead of screen dimensions
|
|
250
258
|
// because screen.width/height don't rotate on iOS PWA
|
|
251
|
-
if (
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
} else {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
}
|
|
259
|
+
// if (isLandscape) {
|
|
260
|
+
// iosWindowWidth = window.innerHeight;
|
|
261
|
+
// iosWindowHeight = window.innerWidth;
|
|
262
|
+
// } else {
|
|
263
|
+
// iosWindowWidth = window.innerWidth;
|
|
264
|
+
// iosWindowHeight = window.innerHeight;
|
|
265
|
+
// }
|
|
266
|
+
|
|
267
|
+
iosWindowWidth = window.innerWidth;
|
|
268
|
+
iosWindowHeight = window.innerHeight;
|
|
258
269
|
|
|
259
270
|
if( debug )
|
|
260
271
|
{
|
|
261
272
|
console.debug('updateIosWidthHeight', {
|
|
262
|
-
|
|
273
|
+
'screen.orientation.type': screen.orientation.type,
|
|
263
274
|
isLandscape,
|
|
264
275
|
'window.innerWidth': window.innerWidth,
|
|
265
276
|
'window.innerHeight': window.innerHeight,
|