Merge pull request #2579 from SillyTavern/fix-tag-management Fix colors resetting on Tag Management dragging

7ccc98803c767cbec5d540b24b252c002c47c67a

Cohee <18619528+Cohee1207@users.noreply.github.com>

Signed
2 files changed, +6 -25Ignore whitespace
public/css/tags.css+6 -6
@@ -209,20 +209,20 @@
209209 opacity: 1;
210210}
211211
212212.tag_as_folder.right_menu_button {
213213 filter: brightness(75%) saturate(0.6);
214214}
215215
216216.tag_as_folder.right_menu_button:hover,
217217.tag_as_folder.right_menu_button.flash {
218218 filter: brightness(150%) saturate(0.6) !important;
219219}
220220
221221.tag_as_folder.right_menu_button.no_folder {
222222 filter: brightness(25%) saturate(0.25);
223223}
224224
225225.tag_as_folder.right_menu_button .tag_folder_indicator {
226226 position: absolute;
227227 top: calc(var(--mainFontSize) * -0.5);
228228 right: calc(var(--mainFontSize) * -0.5);
public/scripts/tags.js+0 -19
@@ -1367,27 +1367,8 @@ function makeTagListDraggable(tagContainer) {
13671367 const id = $(tagElement).attr('id');
13681368 const tag = tags.find(x => x.id === id);
13691369
1370- // Fix the defined colors, because if there is no color set, they seem to get automatically set to black
1371- // based on the color picker after drag&drop, even if there was no color chosen. We just set them back.
1372- const color = $(tagElement).find('.tagColorPickerHolder .tag-color').attr('color');
1373- const color2 = $(tagElement).find('.tagColorPicker2Holder .tag-color2').attr('color');
1374- if (color === '' || color === undefined) {
1375- tag.color = '';
1376- fixColor('background-color', tag.color);
1377- }
1378- if (color2 === '' || color2 === undefined) {
1379- tag.color2 = '';
1380- fixColor('color', tag.color2);
1381- }
1382-
13831370 // Update the sort order
13841371 tag.sort_order = i;
1385-
1386- function fixColor(property, color) {
1387- $(tagElement).find('.tag_view_name').css(property, color);
1388- $(`.tag[id="${id}"]`).css(property, color);
1389- $(`.bogus_folder_select[tagid="${id}"] .avatar`).css(property, color);
1390- }
13911372 });
13921373
13931374 // If tags were dragged manually, we have to disable auto sorting