aboutsummaryrefslogtreecommitdiffstats
path: root/web_src
diff options
context:
space:
mode:
authorYarden Shoham <git@yardenshoham.com>2024-03-31 01:09:46 +0300
committerGitHub <noreply@github.com>2024-03-30 23:09:46 +0100
commit6aeff21b76fcbb10d5ce9009ed4243c14633d899 (patch)
treed8e03a3aad77537343b33d43a694fcc9e2ecd0c2 /web_src
parent2b3f7d3e966ab60cb147115303d1992e8b50d4df (diff)
downloadgitea-6aeff21b76fcbb10d5ce9009ed4243c14633d899.tar.gz
gitea-6aeff21b76fcbb10d5ce9009ed4243c14633d899.zip
Remove jQuery class from the comment edit history (#30186)
- Switched from jQuery class functions to plain JavaScript `classList` - Tested the comment edit history functionality and it works as before Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'web_src')
-rw-r--r--web_src/js/features/repo-issue-content.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/web_src/js/features/repo-issue-content.js b/web_src/js/features/repo-issue-content.js
index 3c4efe0447..cef2f49008 100644
--- a/web_src/js/features/repo-issue-content.js
+++ b/web_src/js/features/repo-issue-content.js
@@ -2,6 +2,7 @@ import $ from 'jquery';
import {svg} from '../svg.js';
import {showErrorToast} from '../modules/toast.js';
import {GET, POST} from '../modules/fetch.js';
+import {showElem} from '../utils/dom.js';
const {appSubUrl} = window.config;
let i18nTextEdited;
@@ -73,10 +74,12 @@ function showContentHistoryDetail(issueBaseUrl, commentId, historyId, itemTitleH
const response = await GET(url);
const resp = await response.json();
- $dialog.find('.comment-diff-data').removeClass('is-loading').html(resp.diffHtml);
+ const commentDiffData = $dialog.find('.comment-diff-data')[0];
+ commentDiffData?.classList.remove('is-loading');
+ commentDiffData.innerHTML = resp.diffHtml;
// there is only one option "item[data-option-item=delete]", so the dropdown can be entirely shown/hidden.
if (resp.canSoftDelete) {
- $dialog.find('.dialog-header-options').removeClass('tw-hidden');
+ showElem($dialog.find('.dialog-header-options'));
}
} catch (error) {
console.error('Error:', error);