mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-27 12:53:57 +01:00
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> (cherry picked from commit 6aeff21b76fcbb10d5ce9009ed4243c14633d899)
This commit is contained in:
parent
bd1419899d
commit
936448e11c
1 changed files with 5 additions and 2 deletions
|
@ -2,6 +2,7 @@ import $ from 'jquery';
|
||||||
import {svg} from '../svg.js';
|
import {svg} from '../svg.js';
|
||||||
import {showErrorToast} from '../modules/toast.js';
|
import {showErrorToast} from '../modules/toast.js';
|
||||||
import {GET, POST} from '../modules/fetch.js';
|
import {GET, POST} from '../modules/fetch.js';
|
||||||
|
import {showElem} from '../utils/dom.js';
|
||||||
|
|
||||||
const {appSubUrl} = window.config;
|
const {appSubUrl} = window.config;
|
||||||
let i18nTextEdited;
|
let i18nTextEdited;
|
||||||
|
@ -73,10 +74,12 @@ function showContentHistoryDetail(issueBaseUrl, commentId, historyId, itemTitleH
|
||||||
const response = await GET(url);
|
const response = await GET(url);
|
||||||
const resp = await response.json();
|
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.
|
// there is only one option "item[data-option-item=delete]", so the dropdown can be entirely shown/hidden.
|
||||||
if (resp.canSoftDelete) {
|
if (resp.canSoftDelete) {
|
||||||
$dialog.find('.dialog-header-options').removeClass('tw-hidden');
|
showElem($dialog.find('.dialog-header-options'));
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error:', error);
|
console.error('Error:', error);
|
||||||
|
|
Loading…
Reference in a new issue