From 2d4bd75ac961d168de65d893cf794720a9137b30 Mon Sep 17 00:00:00 2001 From: fusionate Date: Sat, 18 Feb 2023 00:11:36 +0000 Subject: [PATCH] Dashboard: Fix Save position without change. --- core/dashboard/index.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/core/dashboard/index.php b/core/dashboard/index.php index cc60ce6735..8e626d60ba 100644 --- a/core/dashboard/index.php +++ b/core/dashboard/index.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2022 + Portions created by the Initial Developer are Copyright (C) 2022-2023 the Initial Developer. All Rights Reserved. Contributor(s): @@ -181,7 +181,7 @@ } //show the content - echo "
\n"; + echo "\n"; echo "
\n"; echo "
".$text['title-dashboard']."
\n"; echo "
\n"; @@ -401,6 +401,15 @@ document.getElementById('widget_order').value = widget_ids_list; }, }); + + // set initial widget order + let widget_ids = document.querySelectorAll("#widgets > div[id]"); + let widget_ids_list = []; + for (let i = 0; i < widget_ids.length; i++) { + widget_ids_list.push(widget_ids[i].id); + } + document.getElementById('widget_order').value = widget_ids_list; + } else { // off