Add database/table actions to pattern portfolio

Refs #1066, #1077
This commit is contained in:
Simon Willison 2020-11-02 10:53:52 -08:00
commit d6257e3a7b
3 changed files with 60 additions and 65 deletions

View file

@ -59,22 +59,8 @@
<footer class="ft">{% block footer %}{% include "_footer.html" %}{% endblock %}</footer>
<script>
document.body.addEventListener('click', (ev) => {
/* Close any open details elements that this click is outside of */
var target = ev.target;
var detailsClickedWithin = null;
while (target && target.tagName != 'DETAILS') {
target = target.parentNode;
}
if (target && target.tagName == 'DETAILS') {
detailsClickedWithin = target;
}
Array.from(document.getElementsByTagName('details')).filter(
(details) => details.open && details != detailsClickedWithin
).forEach(details => details.open = false);
});
</script>
{% include "_close_open_menus.html" %}
{% for body_script in body_scripts %}
<script>{{ body_script }}</script>
{% endfor %}