changeset 19756:54981b899406

hgweb: show message when an error occured during ajax loading
author Alexander Plavin <alexander@plav.in>
date Fri, 06 Sep 2013 13:30:58 +0400
parents 00b9f6aab761
children ff00839e8bb3
files mercurial/templates/static/mercurial.js
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/templates/static/mercurial.js	Fri Sep 06 13:30:58 2013 +0400
+++ b/mercurial/templates/static/mercurial.js	Fri Sep 06 13:30:58 2013 +0400
@@ -366,6 +366,7 @@
 
         if (scrollHeight - (scrollTop + clientHeight) < 50) {
             updateInitiated = true;
+            removeByClassName('scroll-loading-error');
 
             if (!nextHash) {
                 var message = {
@@ -400,6 +401,11 @@
                     process_dates();
                 },
                 function onerror(errorText) {
+                    var message = {
+                        class: 'scroll-loading-error',
+                        text: 'Error: ' + errorText
+                    };
+                    appendFormatHTML(container, messageFormat, message);
                 },
                 function oncomplete() {
                     removeByClassName('scroll-loading');