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