diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2014-05-01 16:47:25 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2016-08-15 19:55:40 +0200 |
| commit | 0ab840c3f81b29d6911f1042bc1a0dbcc0c44878 (patch) | |
| tree | c106d3bb95714c181c6737766442300c518620c1 /js | |
| parent | c2963183784b2689f34d525a42fae7b43fe06422 (diff) | |
| download | wvs-vplan-0ab840c3f81b29d6911f1042bc1a0dbcc0c44878.tar.gz wvs-vplan-0ab840c3f81b29d6911f1042bc1a0dbcc0c44878.zip | |
zeige Verbindungsfehler
Diffstat (limited to 'js')
| -rw-r--r-- | js/index.js | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/js/index.js b/js/index.js index 049c0cf..5749631 100644 --- a/js/index.js +++ b/js/index.js @@ -50,6 +50,16 @@ document.addEventListener('resume', function(){ track('event/resume'); }); +document.addEventListener('offline', function offline(){ + $('#loginsubmit').prop('disabled', true); + $('#error_noconn').show('fast'); +}, false); + +document.addEventListener('online', function online(){ + $('#loginsubmit').prop('disabled', false); + $('#error_noconn').hide('fast'); +}, false); + var _paq = _paq || []; $('#mainpage').on('pagebeforeshow', function(){ /* Sprache setzen */ @@ -380,9 +390,9 @@ function renderPdf(url, divstr){ /* wird bei Verbindungsfehlern oder anderen Fehlern aufgerufen */ function fail(text){ $('#lnklogin').click(); - $('#error_noconn').show('fast'); + $('#error_general').show('fast'); console.log('Fehler: ' + text.toString() + ' / ' + text.code); - track('error/connectiondown'); + track('error/general_' + text.toString() + '_' + text.code); } /* entfernt das Logintab */ @@ -577,7 +587,7 @@ function loggedIn(resultHtml){ function sendLogin(username, password){ var params = 'username=' + username + '&password=' + password; - $('#error_noconn').hide('fast'); + $('#error_general').hide('fast'); $('#error_passwd').hide('fast'); var request = $.ajax({ @@ -624,6 +634,10 @@ function getUserData(){ /* loggt ein oder zeigt Loginform */ function login(){ + if(navigator.connection.type === Connection.NONE){ + return; + } + $.mobile.loading('show', {theme: 'a'}); userdata = getUserData(); |
