I need to add a custom close button to replace the standard close function.
Modals is set to autoconvert links that contain a certain text, this works fine.
However I cannot get the JS trigger to work. The documentation gives a Jquery JS code which is outdated with Joomla4.
In the text of the article in the modal I have a line of code for the custom close button:
The code I tried to use:
<p><a class="btn btn-danger" onclick="RegularLabs.Modals.close();">Terug naar overzicht</a></p>
<p><a class="btn btn-danger" onclick="parent.RegularLabs.Modals.close();">Terug naar overzicht</a></p>
<p><a class="btn btn-danger" onclick="RegularLabs.Modals.close(this);">Terug naar overzicht</a></p>
In all cases I get a JS error: Uncaught (in promise) TypeError: element.classList is undefined