move the javascript for autodeleting to a separate winix.js file

This commit is contained in:
Tomasz Sowa 2022-05-30 05:35:49 +02:00
parent 01c10bad0e
commit ba16cf41fe
1 changed files with 8 additions and 13 deletions

View File

@ -20,6 +20,8 @@
[def? winix_load_litepicker false]
[def? winix_load_winixjs true]
[if winix_set_charset]
<meta charset="UTF-8">
@ -51,20 +53,7 @@
[if winix_has_htmx]
<script>htmx.on("htmx:afterOnLoad", function(evt) \{
[# we can optimize it by searching first the <head> tag]
var winix_elements = htmx.findAll(".winix-auto-delete");
for(var i=0 ; i<winix_elements.length ; ++i)
\{
console.log("removing:");
console.log(winix_elements\[i\]);
htmx.remove(winix_elements\[i\]);
\}
\});
</script>
[end]
@ -496,3 +485,9 @@ cm.save()
[end]
[end]
[if winix_load_winixjs]
<script src="[doc_base_url_common]/winix/winix.js"></script>
[end]