fix sortable init

This commit is contained in:
Your Name 2025-01-20 21:23:24 -05:00 committed by Henri Dickson
parent 2dc43c3c53
commit 36b858d82c
3 changed files with 9 additions and 8 deletions

View file

@ -8,7 +8,6 @@
{% get_mark_for_item item as mark %}
{% endif %}
<article class="entity-sort item-card"
draggable="true"
{% if collection_edit %}data-member-id="{{ collection_member.id }}"{% endif %}>
<span class="action">
{% if collection_edit %}

View file

@ -69,13 +69,6 @@
value="{% trans 'Add an item to this collection' %}">
</form>
<script>
$(function () {
sortable('.sortable', {
forcePlaceholderSize: true,
placeholderClass: 'entity-sort--placeholder',
hoverClass: 'entity-sort--hover'
});
});
function update_member_order() {
var member_ids = [];
$('.sortable>.item-card').each(function () {

View file

@ -16,5 +16,14 @@
{% if not request.GET.last_pos and not collection_edit %}
{% trans "nothing so far." %}
{% endif %}
{% if request.GET.edit %}
<script>
sortable('.sortable', {
forcePlaceholderSize: true,
placeholderClass: 'entity-sort--placeholder',
hoverClass: 'entity-sort--hover'
});
</script>
{% endif %}
{% endfor %}
{% if msg %}<script type="text/javascript">alert("{{ msg|escapejs }}");</script>{% endif %}