From abf9f526c07a8ddb9d2d82f6a684782a18b4e59a Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Sun, 28 Jul 2024 20:23:28 +0200 Subject: [PATCH] Fix tag colors resetting on sorting - That workaround is not needed anymore. Colors are now always set on printing the tag list items --- public/scripts/tags.js | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/public/scripts/tags.js b/public/scripts/tags.js index 986f8bd0b..795bb1fa0 100644 --- a/public/scripts/tags.js +++ b/public/scripts/tags.js @@ -1367,27 +1367,8 @@ function makeTagListDraggable(tagContainer) { const id = $(tagElement).attr('id'); const tag = tags.find(x => x.id === id); - // Fix the defined colors, because if there is no color set, they seem to get automatically set to black - // based on the color picker after drag&drop, even if there was no color chosen. We just set them back. - const color = $(tagElement).find('.tagColorPickerHolder .tag-color').attr('color'); - const color2 = $(tagElement).find('.tagColorPicker2Holder .tag-color2').attr('color'); - if (color === '' || color === undefined) { - tag.color = ''; - fixColor('background-color', tag.color); - } - if (color2 === '' || color2 === undefined) { - tag.color2 = ''; - fixColor('color', tag.color2); - } - // Update the sort order tag.sort_order = i; - - function fixColor(property, color) { - $(tagElement).find('.tag_view_name').css(property, color); - $(`.tag[id="${id}"]`).css(property, color); - $(`.bogus_folder_select[tagid="${id}"] .avatar`).css(property, color); - } }); // If tags were dragged manually, we have to disable auto sorting