fix sortable init
This commit is contained in:
parent
2dc43c3c53
commit
36b858d82c
3 changed files with 9 additions and 8 deletions
|
@ -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 %}
|
||||
|
|
|
@ -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 () {
|
||||
|
|
|
@ -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 %}
|
||||
|
|
Loading…
Add table
Reference in a new issue