From 78dabf7003aea98249513db105d1ccc95335b200 Mon Sep 17 00:00:00 2001 From: SillyLossy Date: Sun, 7 May 2023 15:11:10 +0300 Subject: [PATCH] Fix color picker on tag with weird names --- public/scripts/tags.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/scripts/tags.js b/public/scripts/tags.js index 0515463fd..6f3c081f0 100644 --- a/public/scripts/tags.js +++ b/public/scripts/tags.js @@ -312,7 +312,7 @@ function onViewTagsListClick() { template.find('.tag_view_name').text(tag.name); template.find('.tag_view_name').addClass('tag'); template.find('.tag_view_name').css('background-color', tag.color); - const colorPickerId = tag.name + "-tag-color"; + const colorPickerId = tag.id + "-tag-color"; template.find('.tagColorPickerHolder').html( `` ); @@ -321,7 +321,7 @@ function onViewTagsListClick() { list.appendChild(template.get(0)); setTimeout(function () { - document.querySelector(`#${colorPickerId}`).addEventListener('change', (evt) => { + document.querySelector(`.tag-color[id="${colorPickerId}"`).addEventListener('change', (evt) => { onTagColorize(evt); }); }, 100);