@hkdigital/lib-core 0.5.35 → 0.5.37

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,19 +240,26 @@
240
240
 
241
241
  function updateIosWidthHeight() {
242
242
  if (isPwa && isAppleMobile) {
243
+
244
+ // unreliable on ios >>
243
245
  // const angle = screen.orientation.angle;
244
246
  // if( window.matchMedia('(orientation: portrait)').matches ) {
247
+ // isLandscape = false;
248
+ // }
249
+ // else {
250
+ // isLandscape = true;
245
251
  // }
246
252
 
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
- }
253
+ // unreliable on ios >>
254
+ // switch( screen.orientation.type ) {
255
+ // case "portrait-primary":
256
+ // case "portrait-secondary":
257
+ // isLandscape = false;
258
+ // break;
259
+ // default:
260
+ // isLandscape = true;
261
+ // break;
262
+ // }
256
263
 
257
264
  // Use window.inner dimensions instead of screen dimensions
258
265
  // because screen.width/height don't rotate on iOS PWA
@@ -267,6 +274,14 @@
267
274
  iosWindowWidth = window.innerWidth;
268
275
  iosWindowHeight = window.innerHeight;
269
276
 
277
+ if( iosWindowHeight > iosWindowWidth )
278
+ {
279
+ isLandscape = false;
280
+ }
281
+ else {
282
+ isLandscape = true;
283
+ }
284
+
270
285
  if( debug )
271
286
  {
272
287
  console.debug('updateIosWidthHeight', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hkdigital/lib-core",
3
- "version": "0.5.35",
3
+ "version": "0.5.37",
4
4
  "author": {
5
5
  "name": "HKdigital",
6
6
  "url": "https://hkdigital.nl"