forked from FrederikBaerentsen/BrickTracker
Simplify the way javascript is loaded (we don't have that many scripts running) and use data attribute to instantiate grid and tables
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{% import 'macro/table.html' as table %}
|
||||
|
||||
<div class="table-responsive-sm">
|
||||
<table class="table table-striped align-middle {% if not all %}sortable mb-0{% endif %}" {% if all %}id="parts"{% endif %}>
|
||||
<table data-table="{% if all %}true{% endif %}" class="table table-striped align-middle {% if not all %}sortable mb-0{% endif %}" {% if all %}id="parts"{% endif %}>
|
||||
{{ table.header(color=true, quantity=not no_quantity, missing=not no_missing, sets=all, minifigures=all) }}
|
||||
<tbody>
|
||||
{% for item in table_collection %}
|
||||
@@ -51,10 +51,3 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% if all %}
|
||||
<script type="text/javascript">
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
new BrickTable('parts', {{ config['DEFAULT_TABLE_PER_PAGE'] }}, [0], [3, 4, 5, 6]);
|
||||
});
|
||||
</script>
|
||||
{% endif %}
|
||||
Reference in New Issue
Block a user