Patchwork [5,of,9,V2] hgweb: add loading indicator for ajax scrolling

login
register
mail settings
Submitter Alexander Plavin
Date Aug. 17, 2013, 10:33 p.m.
Message ID <8bea23e0f3b00c7ca858.1376778790@debian-alexander.dolgopa>
Download mbox | patch
Permalink /patch/2215/
State Deferred
Headers show

Comments

Alexander Plavin - Aug. 17, 2013, 10:33 p.m.
# HG changeset patch
# User Alexander Plavin <alexander@plav.in>
# Date 1376765071 -14400
#      Sat Aug 17 22:44:31 2013 +0400
# Node ID 8bea23e0f3b00c7ca8582c6f2970adabc6dab2d1
# Parent  e80fe9b70c6fcf6a5d2bd540782574b723d56806
hgweb: add loading indicator for ajax scrolling

Patch

diff -r e80fe9b70c6f -r 8bea23e0f3b0 mercurial/templates/static/mercurial.js
--- a/mercurial/templates/static/mercurial.js	Sat Aug 17 19:51:03 2013 +0400
+++ b/mercurial/templates/static/mercurial.js	Sat Aug 17 22:44:31 2013 +0400
@@ -381,6 +381,11 @@ 
                 format(urlFormat, {hash: nextHash}),
                 'GET',
                 function onstart() {
+                    var message = {
+                        class: 'scroll-loading',
+                        text: 'Loading...'
+                    };
+                    appendFormatHTML(container, messageFormat, message);
                 },
                 function onsuccess(htmlText) {
                     var m = htmlText.match(nextHashRegex);
@@ -396,6 +401,7 @@ 
                 function onerror(errorText) {
                 },
                 function oncomplete() {
+                    removeByClassName('scroll-loading');
                     updateInitiated = false;
                     scrollHandler();
                 }