From bc116a2acfe2450d85229379d54c3344e485db6a Mon Sep 17 00:00:00 2001 From: erdgeist Date: Thu, 30 Jul 2026 19:52:09 +0200 Subject: Replaces the grey slab and filled-box handle with the house card idiom, a tabler grip and icon-only edit and delete actions. Shows each item's non-default translations muted below the title, read from the translation rows rather than the accessor so the fallback chain cannot disguise a missing label as a translated one. Adds move up/down buttons via acts_as_list, the single-pointer alternative WCAG 2.5.7 requires: the jQuery UI sortable binds mouse events only, so dragging works neither on touch nor from the keyboard. The grip is hidden below the desktop breakpoint for the same reason. The sort handler dropped dataType: "json" against a head :ok response, which sent every success down the error path, and now reloads so the disabled chevron states match the stored order after a drag. --- public/javascripts/admin_interface.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'public/javascripts') diff --git a/public/javascripts/admin_interface.js b/public/javascripts/admin_interface.js index ee0b34cd..d94fb623 100644 --- a/public/javascripts/admin_interface.js +++ b/public/javascripts/admin_interface.js @@ -386,9 +386,16 @@ menu_item_sorter = { type: "POST", url: "/menu_items/0/sort", data: $(this).sortable("serialize"), - dataType: "json", - success : function(results) { - alert(results); + success : function() { + // The controller answers head :ok, so there is nothing to parse + // and dataType: "json" would send every success down the error + // path. Reload rather than patch the DOM: first?/last? decide the + // disabled chevrons server-side, and after a drag they describe + // the old order. + window.location.reload(); + }, + error : function() { + alert("Reihenfolge konnte nicht gespeichert werden."); } }); } -- cgit v1.3