@klodd/ds 3.14.2 → 3.14.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/js/pwa-register.js +0 -29
- package/package.json +1 -1
package/js/pwa-register.js
CHANGED
|
@@ -61,31 +61,6 @@
|
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
/*------------------------------------------------------------
|
|
65
|
-
Safe-area cold-start-fix (iOS PWA + Safari)
|
|
66
|
-
iOS Safari beraknar env(safe-area-inset-bottom) felaktigt vid
|
|
67
|
-
forsta render - .bottom-nav landar pa fel position. Att appenda
|
|
68
|
-
ett fixed-positionerat probe-element och lasa dess
|
|
69
|
-
boundingClientRect tvingar WebKit att resolva env-varden i
|
|
70
|
-
layout-passet, vilket retroaktivt korrigerar pillen-positionen.
|
|
71
|
-
|
|
72
|
-
Probe + remove ar mer palitlig an att lasa computed style pa
|
|
73
|
-
.bottom-nav direkt - en frasch fixed-element pa varje event
|
|
74
|
-
tvingar layout regardless av cache-state.
|
|
75
|
-
|
|
76
|
-
Trippel-event-binding tacker alla cold-start-cases:
|
|
77
|
-
- DOMContentLoaded: tidigt efter document parsing
|
|
78
|
-
- load: efter att alla resurser (font, splash, etc.) laddats
|
|
79
|
-
- pageshow: iOS bfcache-restore (back/forward, switch tabs)
|
|
80
|
-
------------------------------------------------------------*/
|
|
81
|
-
function forceSafeAreaOnNav() {
|
|
82
|
-
const probe = doc.createElement('div');
|
|
83
|
-
probe.style.cssText = 'position:fixed;bottom:0;left:0;width:1px;height:1px;opacity:0;pointer-events:none;';
|
|
84
|
-
doc.body.appendChild(probe);
|
|
85
|
-
void probe.getBoundingClientRect();
|
|
86
|
-
probe.remove();
|
|
87
|
-
}
|
|
88
|
-
|
|
89
64
|
/*------------------------------------------------------------
|
|
90
65
|
Public API. Anvand KloddPWA.init({...}) FORE script-laddning av
|
|
91
66
|
denna fil (sa _cfg ar satt nar getCfg() koras), eller bara lat
|
|
@@ -96,8 +71,4 @@
|
|
|
96
71
|
root.KloddPWA.config = cfg;
|
|
97
72
|
|
|
98
73
|
registerSW(cfg);
|
|
99
|
-
|
|
100
|
-
doc.addEventListener('DOMContentLoaded', forceSafeAreaOnNav);
|
|
101
|
-
root.addEventListener('load', forceSafeAreaOnNav);
|
|
102
|
-
root.addEventListener('pageshow', forceSafeAreaOnNav);
|
|
103
74
|
})(typeof window !== 'undefined' ? window : globalThis, document);
|