mirror of
https://github.com/pretix/pretix.git
synced 2026-04-30 00:22:40 +00:00
Provide page offset
This commit is contained in:
@@ -39,7 +39,10 @@
|
||||
<th class="action-col-2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody data-dnd-url="{% url "control:event.items.questions.reorder" organizer=request.event.organizer.slug event=request.event.slug %}">
|
||||
<tbody data-dnd-url="{% url "control:event.items.questions.reorder" organizer=request.event.organizer.slug event=request.event.slug %}"
|
||||
{% if is_paginated %}
|
||||
data-dnd-offset="{{ page_obj.start_index }}"
|
||||
{% endif %}>
|
||||
{% for q in questions %}
|
||||
<tr data-dnd-id="{{q.id}}">
|
||||
<td><strong><a href="
|
||||
|
||||
@@ -3,6 +3,7 @@ $(function () {
|
||||
$("[data-dnd-url]").each(function(){
|
||||
var container = $(this),
|
||||
url = container.data("dnd-url"),
|
||||
offset = container.data("dnd-offset"),
|
||||
up = container.find("a:has(.fa-arrow-up)"),
|
||||
handle = $('<span class="btn btn-default btn-sm dnd-sort-handle"><i class="fa fa-arrows"></i></span>');
|
||||
|
||||
@@ -33,7 +34,8 @@ $(function () {
|
||||
'url': url,
|
||||
'headers': {'X-CSRFToken': $("input[name=csrfmiddlewaretoken]").val()},
|
||||
'data': JSON.stringify({
|
||||
ids: ids
|
||||
ids: ids,
|
||||
offset: offset
|
||||
}),
|
||||
'contentType': "application/json",
|
||||
'timeout': 30000
|
||||
|
||||
Reference in New Issue
Block a user