Skip to content

Commit

Permalink
Remove jQuery from the comment task list (#29170)
Browse files Browse the repository at this point in the history
- 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>
  • Loading branch information
4 people authored Feb 15, 2024
1 parent 78c48d8 commit 542480a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions web_src/js/markup/tasklist.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import $ from 'jquery';
import {POST} from '../modules/fetch.js';

const preventListener = (e) => e.preventDefault();

Expand Down Expand Up @@ -55,12 +55,11 @@ export function initMarkupTasklist() {
const updateUrl = editContentZone.getAttribute('data-update-url');
const context = editContentZone.getAttribute('data-context');

await $.post(updateUrl, {
ignore_attachments: true,
_csrf: window.config.csrfToken,
content: newContent,
context
});
const requestBody = new FormData();
requestBody.append('ignore_attachments', 'true');
requestBody.append('content', newContent);
requestBody.append('context', context);
await POST(updateUrl, {data: requestBody});

rawContent.textContent = newContent;
} catch (err) {
Expand Down

0 comments on commit 542480a

Please sign in to comment.