From a5410f6d3748c57fc02da33eef842f993b8bc251 Mon Sep 17 00:00:00 2001 From: maTh Date: Mon, 15 Nov 2021 22:03:26 +0100 Subject: Fix issue with mark-all-as-read-button in anonym. mode (#3944) * fix * Update p/scripts/main.js Co-authored-by: Alexandre Alapetite --- p/scripts/main.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'p/scripts/main.js') diff --git a/p/scripts/main.js b/p/scripts/main.js index 0a828f04c..f7a4d17f3 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -1546,11 +1546,12 @@ function load_more_posts() { formPagination.replaceChild(paginationNew, paginationOld); const bigMarkAsRead = document.getElementById('bigMarkAsRead'); - if (bigMarkAsRead) { + const readAll = document.querySelector('#nav_menu_read_all .read_all'); + if (readAll && bigMarkAsRead && bigMarkAsRead.formAction) { if (context.display_order === 'ASC') { - document.querySelector('#nav_menu_read_all .read_all').formAction = bigMarkAsRead.formAction; + readAll.formAction = bigMarkAsRead.formAction; } else { - bigMarkAsRead.formAction = document.querySelector('#nav_menu_read_all .read_all').formAction; + bigMarkAsRead.formAction = readAll.formAction; } } -- cgit v1.2.3