Patchwork [2,of,3,V2] hgweb: stop issuing ajax requests when there are no more entries in the list

login
register
mail settings
Submitter Alexander Plavin
Date Aug. 17, 2013, 10:32 p.m.
Message ID <0d194d5be6416a785f71.1376778725@debian-alexander.dolgopa>
Download mbox | patch
Permalink /patch/2209/
State Deferred
Headers show

Comments

Alexander Plavin - Aug. 17, 2013, 10:32 p.m.
# HG changeset patch
# User Alexander Plavin <alexander@plav.in>
# Date 1376770061 -14400
#      Sun Aug 18 00:07:41 2013 +0400
# Node ID 0d194d5be6416a785f7128d37a5f944af21d999c
# Parent  5b8793da98a62a2c86adbd6d76a8c4608ba9edf6
hgweb: stop issuing ajax requests when there are no more entries in the list

Patch

diff -r 5b8793da98a6 -r 0d194d5be641 mercurial/templates/static/mercurial.js
--- a/mercurial/templates/static/mercurial.js	Sat Aug 17 19:48:36 2013 +0400
+++ b/mercurial/templates/static/mercurial.js	Sun Aug 18 00:07:41 2013 +0400
@@ -356,6 +356,10 @@ 
         if (scrollHeight - (scrollTop + clientHeight) < 50) {
             updateInitiated = true;
 
+            if (!nextHash) {
+                return;
+            }
+
             makeRequest(
                 format(urlFormat, {hash: nextHash}),
                 'GET',