From 542480a9b0d5cdb497dbfa99752d59fd016df0d6 Mon Sep 17 00:00:00 2001 From: Yarden Shoham Date: Thu, 15 Feb 2024 15:27:07 +0200 Subject: [PATCH] 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 Co-authored-by: wxiaoguang Co-authored-by: Giteabot Co-authored-by: silverwind --- web_src/js/markup/tasklist.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/web_src/js/markup/tasklist.js b/web_src/js/markup/tasklist.js index ad1c6964a757..00076bce5891 100644 --- a/web_src/js/markup/tasklist.js +++ b/web_src/js/markup/tasklist.js @@ -1,4 +1,4 @@ -import $ from 'jquery'; +import {POST} from '../modules/fetch.js'; const preventListener = (e) => e.preventDefault(); @@ -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) {