From: Robert Kaiser Date: Sun, 21 Jan 2018 22:34:59 +0000 (+0100) Subject: make drawers work again on small screens, show a warning when indexedDB is not loading X-Git-Tag: production~9 X-Git-Url: https://git-public.kairo.at/?p=lantea.git;a=commitdiff_plain;h=0713fd6a18112db2b55d7e2e3c4b58658fb4c030 make drawers work again on small screens, show a warning when indexedDB is not loading --- diff --git a/index.html b/index.html index c01c0ac..092d7c0 100644 --- a/index.html +++ b/index.html @@ -148,6 +148,10 @@ upload from multiple devices.

Unable to initialize WebGL. You need a browser that supports it.
+
+ Unable to open indexedDB database in your browser. Please make sure you have + not disabled access to in-browser storage. +

Welcome to Lantea Maps!

This web app lets you record GPS tracks of your journeys, which you can diff --git a/js/ui.js b/js/ui.js index 92dd488..0c8af9a 100644 --- a/js/ui.js +++ b/js/ui.js @@ -239,11 +239,15 @@ function initDB(aEvent) { request.onerror = function(event) { // Errors can be handled here. Error codes explain in: // https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#Constants - if (gDebug) - console.log("error opening mainDB: " + event.target.errorCode); + console.log("error opening mainDB: " + event.target.error); + showDBErrorDialog(); + if (gDebug) { + console.log("error code: " + event.target.error.code + + " - name: " + event.target.error.name); + } }; request.onsuccess = function(event) { - mainDB = request.result; + mainDB = event.target.result; var throwEv = new CustomEvent("dbinit-done"); gAction.dispatchEvent(throwEv); }; @@ -382,6 +386,16 @@ function showGLWarningDialog() { dia.classList.remove("hidden"); } +function showDBErrorDialog() { + var dia = document.getElementById("dialogArea"); + var areas = dia.children; + for (var i = 0; i <= areas.length - 1; i++) { + areas[i].style.display = "none"; + } + document.getElementById("DBError").style.display = "block"; + dia.classList.remove("hidden"); +} + function showFirstRunDialog() { var dia = document.getElementById("dialogArea"); var areas = dia.children; diff --git a/manifest.appcache b/manifest.appcache index 8cbeac3..e4fd815 100644 --- a/manifest.appcache +++ b/manifest.appcache @@ -1,6 +1,6 @@ CACHE MANIFEST -# 2018-01-21 +# 2018-01-22 index.html login.html manifest.webapp diff --git a/style/lantea.css b/style/lantea.css index dbc28b0..16bacfc 100644 --- a/style/lantea.css +++ b/style/lantea.css @@ -183,7 +183,7 @@ h1 { @media screen and (max-width: 330px) { .menuDrawer { - left: calc(-300px - 1ch); /* account for padding */ + transform: translateX(calc(-300px - 1ch)); /* account for padding */ width: 300px; } }