changeset 1044:41921e6ada54 draft default tip

Modify procedure of resetPjaxViewers()
author HIROSE Yuuji <yuuji@gentei.org>
date Fri, 24 May 2024 06:40:03 +0900
parents dd1115454635
children
files s4-main.js
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/s4-main.js	Fri May 24 06:26:08 2024 +0900
+++ b/s4-main.js	Fri May 24 06:40:03 2024 +0900
@@ -88,9 +88,6 @@
 	    textarea.value = lines.join("\n");
 	}
     }
-    function resetPjaxViewers() {
-	art_m_list = [];
-    }
     function registPjaxViewers(aHrefList) {
 	let apos=art_m_list.length;
 	for (let a of aHrefList) {
@@ -120,6 +117,10 @@
 	    }
 	}
     }
+    function resetPjaxViewers(arefs) {
+	art_m_list = [];
+	registPjaxViewers(arefs)
+    }
     function registInsertDirect(aHrefList) {
 	for (i of aHrefList)
 	    if (i.getAttribute("href").match(/^#[0-9]+$/))
@@ -1022,8 +1023,7 @@
 		}
 		sbtn.textContent = uidsort ? amode : umode;
 		// Re-sort pjax viewer links
-		resetPjaxViewers();
-		registPjaxViewers(document.querySelectorAll("a[href]"));
+		resetPjaxViewers(document.querySelectorAll("a[href]"));
 	    });
 	}
 	/*****************************************************************/

yatex.org