From 6c29e17e2ca5c97680053abb749596846e4ffb86 Mon Sep 17 00:00:00 2001 From: Masterjun Date: Wed, 4 Oct 2023 15:25:55 +0200 Subject: [PATCH] fix regression of tag retention support when obsoleting movies (#1708) --- TASVideos/Pages/Submissions/Publish.cshtml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/TASVideos/Pages/Submissions/Publish.cshtml b/TASVideos/Pages/Submissions/Publish.cshtml index ad0679de6..b17379cd7 100644 --- a/TASVideos/Pages/Submissions/Publish.cshtml +++ b/TASVideos/Pages/Submissions/Publish.cshtml @@ -155,11 +155,6 @@ let originalDescription = "@Model.Submission.MovieMarkup"; const obsoletionModel = document.getElementById("@Html.IdFor(m => m.Submission.MovieToObsolete)"); const descriptionModel = document.getElementById("@Html.IdFor(m => m.Submission.MovieMarkup)"); - const dblClickEvent = new MouseEvent('dblclick', { - 'view': window, - 'bubbles': true, - 'cancelable': true - }); descriptionModel.onchange = function() { originalDescription = descriptionModel.value; @@ -181,15 +176,12 @@ descriptionModel.value = t.markup; originalDescription = oldValue; - document.getElementById(`${selectedTagsId}removeAllBtn`).click(); document.getElementById("obsoleted-by").innerHTML = t.title ? t.title : "Unknown publication"; - for (let i in t.tags) { - const tagItem = document.querySelector(`[name='AvailableTags'] option[value="${t.tags[i]}"]`); - tagItem.selected = true; + for (let option of document.querySelectorAll(`#${selectedTagsId} option`)) { + option.selected = t.tags.includes(Number(option.value)); } - - document.getElementById(`${selectedTagsId}addBtn`).click(); + engageSelectImprover('@Html.IdFor(m => m.Submission.SelectedTags)'); }); }