Remove jQuery from the comment task list (#29170)

- Switched to plain JavaScript
- Tested the task list functionality and it works as before

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 542480a9b0d5cdb497dbfa99752d59fd016df0d6)
This commit is contained in:
Yarden Shoham 2024-02-15 15:27:07 +02:00 committed by Earl Warren
parent df439b6a98
commit c2d4c2fca7
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -1,4 +1,4 @@
import $ from 'jquery'; import {POST} from '../modules/fetch.js';
const preventListener = (e) => e.preventDefault(); const preventListener = (e) => e.preventDefault();
@ -55,12 +55,11 @@ export function initMarkupTasklist() {
const updateUrl = editContentZone.getAttribute('data-update-url'); const updateUrl = editContentZone.getAttribute('data-update-url');
const context = editContentZone.getAttribute('data-context'); const context = editContentZone.getAttribute('data-context');
await $.post(updateUrl, { const requestBody = new FormData();
ignore_attachments: true, requestBody.append('ignore_attachments', 'true');
_csrf: window.config.csrfToken, requestBody.append('content', newContent);
content: newContent, requestBody.append('context', context);
context await POST(updateUrl, {data: requestBody});
});
rawContent.textContent = newContent; rawContent.textContent = newContent;
} catch (err) { } catch (err) {