@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
- // Use screen.orientation.angle as the source of truth
246
- // angle 90/270 = landscape, angle 0/180 = portrait
247
- isLandscape = (angle === 90 || angle === 270);
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 (angle === 90 || angle === 270) {
252
- iosWindowWidth = window.innerHeight;
253
- iosWindowHeight = window.innerWidth;
254
- } else {
255
- iosWindowWidth = window.innerWidth;
256
- iosWindowHeight = window.innerHeight;
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
- angle,
273
+ 'screen.orientation.type': screen.orientation.type,
263
274
  isLandscape,
264
275
  'window.innerWidth': window.innerWidth,
265
276
  'window.innerHeight': window.innerHeight,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hkdigital/lib-core",
3
- "version": "0.5.33",
3
+ "version": "0.5.35",
4
4
  "author": {
5
5
  "name": "HKdigital",
6
6
  "url": "https://hkdigital.nl"