From 4029ec37134cfffd80e9542df0d743b6a3bb4b84 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 29 Jan 2021 13:36:50 -0500 Subject: [PATCH] fix: multiple sorted-lists do not save to the correct set --- public/src/modules/settings.js | 4 +++- public/src/modules/settings/sorted-list.js | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/public/src/modules/settings.js b/public/src/modules/settings.js index 8593e12689..f190f64500 100644 --- a/public/src/modules/settings.js +++ b/public/src/modules/settings.js @@ -531,7 +531,9 @@ define('settings', function () { helper.whenReady(function () { var list = formEl.find('[data-sorted-list]'); if (list.length) { - getHook(list, 'set').call(Settings, list, values); + list.each((idx, item) => { + getHook(item, 'set').call(Settings, $(item), values); + }); } }); diff --git a/public/src/modules/settings/sorted-list.js b/public/src/modules/settings/sorted-list.js index e972481c05..c7ea58d4bb 100644 --- a/public/src/modules/settings/sorted-list.js +++ b/public/src/modules/settings/sorted-list.js @@ -70,7 +70,6 @@ define('settings/sorted-list', [ function setupRemoveButton($container, itemUUID) { var removeBtn = $container.find('[data-sorted-list-uuid="' + itemUUID + '"] [data-type="remove"]'); removeBtn.on('click', function () { - console.log(itemUUID); $('[data-sorted-list-uuid="' + itemUUID + '"]').remove(); }); }