From 2771a95d40f4b4339d75096923bb63a5b989ce01 Mon Sep 17 00:00:00 2001
From: Nikhil Tanwar <2002nikhiltanwar@gmail.com>
Date: Sat, 14 May 2022 15:50:27 +0530
Subject: [PATCH] Floor the value returned by viewPortToCount()
Previously, the value returned by viewPortToCount() could be a decimal number, this floors its value.
Helps in clean requests and caching.
Fix #766
---
static/skin/index.js | 2 +-
test/server.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/static/skin/index.js b/static/skin/index.js
index 62e6d5d6c..15cc0b166 100644
--- a/static/skin/index.js
+++ b/static/skin/index.js
@@ -69,7 +69,7 @@
function viewPortToCount(){
const zoom = Math.floor((( window.outerWidth - 10 ) / window.innerWidth) * 100);
- return Math.floor(window.innerHeight/(3*zoom) + 1)*(window.innerWidth/(2.5*zoom) + 1);
+ return Math.floor((window.innerHeight/(3*zoom) + 1)*(window.innerWidth/(2.5*zoom) + 1));
}
function getInnerHtml(node, query) {
diff --git a/test/server.cpp b/test/server.cpp
index b3d5ec834..0b5e5bb95 100644
--- a/test/server.cpp
+++ b/test/server.cpp
@@ -319,7 +319,7 @@ R"EXPECTEDRESULT( src="/ROOT/skin/jquery-ui/external/jquery/jquery.js?cache
src: url("/ROOT/skin/fonts/Roboto.ttf?cacheid=84d10248") format("truetype");
-
+
)EXPECTEDRESULT"
},
{