From: Radek Czajka Date: Thu, 7 Oct 2010 13:43:23 +0000 (+0200) Subject: fix out-of-date check, don't panic on failed ajax X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/a8045c91f2dc8ae51ca5140b54f4419a6f0c0087?hp=298031e8a452a9012bc43098a32f60f5b5a2b152 fix out-of-date check, don't panic on failed ajax --- diff --git a/redakcja/static/js/wiki/loader.js b/redakcja/static/js/wiki/loader.js index 7e5c8645..f2d7fb71 100644 --- a/redakcja/static/js/wiki/loader.js +++ b/redakcja/static/js/wiki/loader.js @@ -113,7 +113,7 @@ $(function() /* every 5 minutes check for a newer version */ var revTimer = setInterval(function() { - CurrentDocument.checkRevision({error: function(){ + CurrentDocument.checkRevision({outdated: function(){ $('#header').addClass('out-of-date'); clearInterval(revTimer); }}); diff --git a/redakcja/static/js/wiki/wikiapi.js b/redakcja/static/js/wiki/wikiapi.js index bce1f897..a518410e 100644 --- a/redakcja/static/js/wiki/wikiapi.js +++ b/redakcja/static/js/wiki/wikiapi.js @@ -163,8 +163,10 @@ url: reverse("ajax_document_rev", self.id), dataType: 'text', success: function(data) { - if (data != self.revision) + if (data == '' && params.error) params.error(); + else if (data != self.revision) + params.outdated(); } }); };