forked from CGM_Public/pretix_original
Question list: Drop pagination, allow to mix ordering with system fields
This commit is contained in:
@@ -3,21 +3,10 @@ $(function () {
|
||||
$("[data-dnd-url]").each(function(){
|
||||
var container = $(this),
|
||||
url = container.data("dnd-url"),
|
||||
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>');
|
||||
|
||||
function hideArrows(container){
|
||||
var up = container.find("a:has(.fa-arrow-up)"),
|
||||
firstUp = up.first(),
|
||||
down = container.find("a:has(.fa-arrow-down)"),
|
||||
lastDown = down.last();
|
||||
up.not(firstUp).css("display","none");
|
||||
down.not(lastDown).css("display","none");
|
||||
firstUp.css("display","inline-block");
|
||||
lastDown.css("display","inline-block");
|
||||
}
|
||||
up.after(handle);
|
||||
hideArrows(container);
|
||||
console.log(container, container.find(".dnd-container"));
|
||||
container.find(".dnd-container").append(handle);
|
||||
|
||||
Sortable.create(container.get(0), {
|
||||
handle: ".dnd-sort-handle",
|
||||
@@ -25,8 +14,6 @@ $(function () {
|
||||
var container = $(evt.to),
|
||||
ids = container.find("[data-dnd-id]").toArray().map(function (e) { return e.dataset.dndId; });
|
||||
|
||||
hideArrows(container);
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
'type': 'POST',
|
||||
|
||||
Reference in New Issue
Block a user