fix out-of-date check, don't panic on failed ajax
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Thu, 7 Oct 2010 13:43:23 +0000 (15:43 +0200)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Thu, 7 Oct 2010 13:43:23 +0000 (15:43 +0200)
redakcja/static/js/wiki/loader.js
redakcja/static/js/wiki/wikiapi.js

index 7e5c864..f2d7fb7 100644 (file)
@@ -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);
                         }});
index bce1f89..a518410 100644 (file)
             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();
             }
         });
     };