summaryrefslogtreecommitdiff
path: root/public/javascripts/admin_interface.js
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-30 19:52:09 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-30 19:52:09 +0200
commitbc116a2acfe2450d85229379d54c3344e485db6a (patch)
treebd49c465f45bcec6251325d406c7de3cd6733ddf /public/javascripts/admin_interface.js
parent6a1102e69230ed62138b8e6aec8a6348e8571b23 (diff)
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.
Diffstat (limited to 'public/javascripts/admin_interface.js')
-rw-r--r--public/javascripts/admin_interface.js13
1 files changed, 10 insertions, 3 deletions
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 = {
386 type: "POST", 386 type: "POST",
387 url: "/menu_items/0/sort", 387 url: "/menu_items/0/sort",
388 data: $(this).sortable("serialize"), 388 data: $(this).sortable("serialize"),
389 dataType: "json", 389 success : function() {
390 success : function(results) { 390 // The controller answers head :ok, so there is nothing to parse
391 alert(results); 391 // and dataType: "json" would send every success down the error
392 // path. Reload rather than patch the DOM: first?/last? decide the
393 // disabled chevrons server-side, and after a drag they describe
394 // the old order.
395 window.location.reload();
396 },
397 error : function() {
398 alert("Reihenfolge konnte nicht gespeichert werden.");
392 } 399 }
393 }); 400 });
394 } 401 }