From e890ec3eb646f0786a42da7f6f9a4f7760018e22 Mon Sep 17 00:00:00 2001
From: Timm Fitschen <t.fitschen@indiscale.com>
Date: Thu, 3 Jun 2021 10:32:48 +0000
Subject: [PATCH] FIX: paging was not initialized correctly

---
 CHANGELOG.md             |  1 +
 src/core/js/webcaosdb.js | 15 ++++++---------
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 58063e36..57472cad 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -36,6 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ### Fixed
 
+* #214 - Paging panel is hidden.
 * #156 - Edit mode for Safari 11
 * #160 - Entity preview for Safari 11
 * Several minor cosmetic flaws
diff --git a/src/core/js/webcaosdb.js b/src/core/js/webcaosdb.js
index 6d374824..221b8b5a 100644
--- a/src/core/js/webcaosdb.js
+++ b/src/core/js/webcaosdb.js
@@ -1287,7 +1287,10 @@ var paging = new function () {
     }
 
     this.init = function () {
-        paging.initPaging(window.location.href, document.body.getAttribute("data-response-count"));
+        var response_count = document.body.getAttribute("data-response-count");
+        if (parseInt(response_count) >= 0) {
+            paging.initPaging(window.location.href, response_count);
+        }
     }
 };
 
@@ -1867,18 +1870,12 @@ this.user_management = function ($, connection, createWaitingNotification, creat
     };
 }($, connection, createWaitingNotification, createErrorNotification);
 
-/**
- * When the page is scrolled down 100 pixels, the scroll-back button appears.
- * 
- * @return FIXME
- */
 
 /**
- * Every initial function calling is done here.
- * 
- * @return TODO
+ * Initialize all the submodules.
  */
 function initOnDocumentReady() {
+    paging.init();
     hintMessages.init();
 
     // init query form
-- 
GitLab