Question list: Drop pagination, allow to mix ordering with system fields

This commit is contained in:
Raphael Michel
2020-06-23 13:05:54 +02:00
parent 868292f9b3
commit 2a5c24482e
8 changed files with 215 additions and 204 deletions

View File

@@ -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',