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 %}
|
{% get_mark_for_item item as mark %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<article class="entity-sort item-card"
|
<article class="entity-sort item-card"
|
||||||
draggable="true"
|
|
||||||
{% if collection_edit %}data-member-id="{{ collection_member.id }}"{% endif %}>
|
{% if collection_edit %}data-member-id="{{ collection_member.id }}"{% endif %}>
|
||||||
<span class="action">
|
<span class="action">
|
||||||
{% if collection_edit %}
|
{% if collection_edit %}
|
||||||
|
|
|
@ -69,13 +69,6 @@
|
||||||
value="{% trans 'Add an item to this collection' %}">
|
value="{% trans 'Add an item to this collection' %}">
|
||||||
</form>
|
</form>
|
||||||
<script>
|
<script>
|
||||||
$(function () {
|
|
||||||
sortable('.sortable', {
|
|
||||||
forcePlaceholderSize: true,
|
|
||||||
placeholderClass: 'entity-sort--placeholder',
|
|
||||||
hoverClass: 'entity-sort--hover'
|
|
||||||
});
|
|
||||||
});
|
|
||||||
function update_member_order() {
|
function update_member_order() {
|
||||||
var member_ids = [];
|
var member_ids = [];
|
||||||
$('.sortable>.item-card').each(function () {
|
$('.sortable>.item-card').each(function () {
|
||||||
|
|
|
@ -16,5 +16,14 @@
|
||||||
{% if not request.GET.last_pos and not collection_edit %}
|
{% if not request.GET.last_pos and not collection_edit %}
|
||||||
{% trans "nothing so far." %}
|
{% trans "nothing so far." %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if request.GET.edit %}
|
||||||
|
<script>
|
||||||
|
sortable('.sortable', {
|
||||||
|
forcePlaceholderSize: true,
|
||||||
|
placeholderClass: 'entity-sort--placeholder',
|
||||||
|
hoverClass: 'entity-sort--hover'
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if msg %}<script type="text/javascript">alert("{{ msg|escapejs }}");</script>{% endif %}
|
{% if msg %}<script type="text/javascript">alert("{{ msg|escapejs }}");</script>{% endif %}
|
||||||
|
|
Loading…
Add table
Reference in a new issue