Attempt to improve initial page load by adding defer attribute to scripts, will attempt to add defer to inline scripts as well soon

This commit is contained in:
Peter Stockings
2023-08-15 22:31:08 +10:00
parent d3df532570
commit c6c9925da0
7 changed files with 31 additions and 29 deletions

View File

@@ -19,7 +19,7 @@
</select>
</div>
<script>
te.Select.getOrCreateInstance(document.querySelector("#topset-exercise-select-{{ topset_id }}")).setValue("{{ exercise_id }}");
window.addEventListener('DOMContentLoaded', _ => te.Select.getOrCreateInstance(document.querySelector("#topset-exercise-select-{{ topset_id }}")).setValue("{{ exercise_id }}"));
</script>
{% endif %}
</td>