From 9e6699c5498a3c9e9ca876b57b2bcfe11db7c6dd Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sat, 16 Dec 2023 01:03:27 +0000 Subject: [PATCH] Collection Editor: Use id rather than vague class --- app/public/static/js/collection_editor.js | 4 ++-- app/templates/collections/create_edit.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/public/static/js/collection_editor.js b/app/public/static/js/collection_editor.js index 8adfba89..e6bda5c8 100644 --- a/app/public/static/js/collection_editor.js +++ b/app/public/static/js/collection_editor.js @@ -5,10 +5,10 @@ function updateOrder() { - const elements = [...document.querySelector(".sortable").children]; + const elements = [...document.querySelector("#package_list").children]; const ids = elements .filter(x => !x.classList.contains("d-none")) - .map(x => x.dataset.id) + .map(x => x.dataset.id?.trim()) .filter(x => x); document.querySelector("input[name='order']").value = ids.join(","); diff --git a/app/templates/collections/create_edit.html b/app/templates/collections/create_edit.html index 5f952947..ea8e3012 100644 --- a/app/templates/collections/create_edit.html +++ b/app/templates/collections/create_edit.html @@ -11,7 +11,7 @@ {% block scriptextra %} - + {% from "macros/forms.html" import easymde_scripts %} {{ easymde_scripts() }} {% endblock %}