From a8045c91f2dc8ae51ca5140b54f4419a6f0c0087 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Thu, 7 Oct 2010 15:43:23 +0200 Subject: [PATCH] fix out-of-date check, don't panic on failed ajax --- redakcja/static/js/wiki/loader.js | 2 +- redakcja/static/js/wiki/wikiapi.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) 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(); } }); }; -- 2.20.1