From 596b223a9dd6160b18d1212a53b06b4e7fcc450a Mon Sep 17 00:00:00 2001
From: Nikhil Tanwar <2002nikhiltanwar@gmail.com>
Date: Sat, 25 Jun 2022 18:26:22 +0530
Subject: [PATCH] Drop onclick handler for reset-filter link
This removes the onclick handler around the reset-filter link which redirected to '/?lang='
Everything under the handler was already done on window.onload
---
static/skin/index.js | 16 +---------------
test/server.cpp | 2 +-
2 files changed, 2 insertions(+), 16 deletions(-)
diff --git a/static/skin/index.js b/static/skin/index.js
index 2b5a4149..c33c47d9 100644
--- a/static/skin/index.js
+++ b/static/skin/index.js
@@ -277,23 +277,9 @@
setTimeout(() => {
const divTag = document.createElement('div');
divTag.setAttribute('class', 'noResults');
- divTag.innerHTML = `No result. Would you like to reset filter?`;
+ divTag.innerHTML = `No result. Would you like to reset filter?`;
kiwixHomeBody.append(divTag);
kiwixHomeBody.setAttribute('style', 'display: flex; justify-content: center; align-items: center');
- divTag.getElementsByTagName('a')[0].onclick = (event) => {
- event.preventDefault();
- window.history.pushState({}, null, `?lang=`);
- setCookie(filterCookieName, 'lang=');
- resetAndFilter();
- document.querySelectorAll('.filter').forEach(filter => {
- filter.value = params.get(filter.name) || '';
- if (filter.value) {
- filter.style = 'background-color: #858585; color: #fff';
- } else {
- filter.style = 'background-color: #ffffff; color: black';
- }
- })
- };
loader.setAttribute('style', 'position: absolute; top: 50%');
}, 300);
}
diff --git a/test/server.cpp b/test/server.cpp
index 992ffb9c..a0c22362 100644
--- a/test/server.cpp
+++ b/test/server.cpp
@@ -184,7 +184,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"
},
{