Skip to content

Commit 6aeff21

Browse files
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 <[email protected]> Co-authored-by: Giteabot <[email protected]>
1 parent 2b3f7d3 commit 6aeff21

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

web_src/js/features/repo-issue-content.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import $ from 'jquery';
22
import {svg} from '../svg.js';
33
import {showErrorToast} from '../modules/toast.js';
44
import {GET, POST} from '../modules/fetch.js';
5+
import {showElem} from '../utils/dom.js';
56

67
const {appSubUrl} = window.config;
78
let i18nTextEdited;
@@ -73,10 +74,12 @@ function showContentHistoryDetail(issueBaseUrl, commentId, historyId, itemTitleH
7374
const response = await GET(url);
7475
const resp = await response.json();
7576

76-
$dialog.find('.comment-diff-data').removeClass('is-loading').html(resp.diffHtml);
77+
const commentDiffData = $dialog.find('.comment-diff-data')[0];
78+
commentDiffData?.classList.remove('is-loading');
79+
commentDiffData.innerHTML = resp.diffHtml;
7780
// there is only one option "item[data-option-item=delete]", so the dropdown can be entirely shown/hidden.
7881
if (resp.canSoftDelete) {
79-
$dialog.find('.dialog-header-options').removeClass('tw-hidden');
82+
showElem($dialog.find('.dialog-header-options'));
8083
}
8184
} catch (error) {
8285
console.error('Error:', error);

0 commit comments

Comments
 (0)