bug fix: Tiles werden nach Chat nicht geladen
This commit is contained in:
1 parent
95486c6737
commit
23a9df66f4
2 files changed
+19
-1
No files matched your search
@@ -5,7 +5,7 @@
|
|||||||
* damit er sowohl die mobilen Views als auch die statischen Assets
|
* damit er sowohl die mobilen Views als auch die statischen Assets
|
||||||
* kontrolliert. Der Cache-Name wird pro App-Wurzel gebildet.
|
* kontrolliert. Der Cache-Name wird pro App-Wurzel gebildet.
|
||||||
*/
|
*/
|
||||||
const VERSION = 'cmbnet-pwa-v12';
|
const VERSION = 'cmbnet-pwa-v13';
|
||||||
const BASE = new URL('./', self.location).href;
|
const BASE = new URL('./', self.location).href;
|
||||||
const SHELL_CACHE = `${VERSION}-shell`;
|
const SHELL_CACHE = `${VERSION}-shell`;
|
||||||
const TILE_CACHE = `${VERSION}-tiles`;
|
const TILE_CACHE = `${VERSION}-tiles`;
|
||||||
|
|||||||
@@ -472,11 +472,29 @@ function bindTabs() {
|
|||||||
if (btn.dataset.tab === 'chat') {
|
if (btn.dataset.tab === 'chat') {
|
||||||
const cont = document.getElementById('mobileChatMessages');
|
const cont = document.getElementById('mobileChatMessages');
|
||||||
if (cont) cont.scrollTop = cont.scrollHeight;
|
if (cont) cont.scrollTop = cont.scrollHeight;
|
||||||
|
} else if (btn.dataset.tab === 'map') {
|
||||||
|
refreshMobileMap();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function refreshMobileMap() {
|
||||||
|
if (!map) return;
|
||||||
|
|
||||||
|
// Während der Chat-Ansicht ist der Kartencontainer display:none. Beim
|
||||||
|
// Zurückwechseln muss Leaflet die Größe neu messen. Zusätzlich werden die
|
||||||
|
// Kacheln neu angefordert, da sie im versteckten Zustand nicht aktualisiert
|
||||||
|
// wurden.
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
if (!map) return;
|
||||||
|
map.invalidateSize({pan: false});
|
||||||
|
if (currentBaseLayer && typeof currentBaseLayer.redraw === 'function') {
|
||||||
|
currentBaseLayer.redraw();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function bindButtons() {
|
function bindButtons() {
|
||||||
const logout = document.getElementById('mobileLogout');
|
const logout = document.getElementById('mobileLogout');
|
||||||
if (logout) logout.addEventListener('click', () => {window.location.href = window.CMBNET_LOGOUT_URL || appUrl('');});
|
if (logout) logout.addEventListener('click', () => {window.location.href = window.CMBNET_LOGOUT_URL || appUrl('');});
|
||||||
|
|||||||
Reference in new issue
Block a user