From 7b631657e5ed06b54dbcd457cdad50f3a60b0196 Mon Sep 17 00:00:00 2001 From: Renato Date: Wed, 16 Oct 2024 11:44:06 -0300 Subject: [PATCH] fix: npm lint errors --- .../decidim/append_redirect_url_to_modals.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/decidim-core/app/packs/src/decidim/append_redirect_url_to_modals.js b/decidim-core/app/packs/src/decidim/append_redirect_url_to_modals.js index 4f87a68d5ade7..37d4aac0acf3d 100644 --- a/decidim-core/app/packs/src/decidim/append_redirect_url_to_modals.js +++ b/decidim-core/app/packs/src/decidim/append_redirect_url_to_modals.js @@ -55,8 +55,9 @@ $(() => { $(document).on("click.zf.trigger", (event) => { // Try to get the directly or find the closest parent let $target = $(event.target); - if (!$target.is('a')) { - $target = $target.closest('a'); // Find the closest parent if the click is not directly on an + if (!$target.is("a")) { + // Find the closest parent if the click is not directly on an + $target = $target.closest("a"); } // Check if an was found @@ -65,15 +66,15 @@ $(() => { const redirectUrl = $target.data("redirectUrl"); if (dialogTarget && redirectUrl) { - $("") - .attr("id", "redirect_url") - .attr("name", "redirect_url") - .attr("value", redirectUrl) - .appendTo(`${dialogTarget} form`); + $(""). + attr("id", "redirect_url"). + attr("name", "redirect_url"). + attr("value", redirectUrl). + appendTo(`${dialogTarget} form`); $(`${dialogTarget} a`).attr("href", (index, href) => { - const querystring = jQuery.param({"redirect_url": redirectUrl}); - return href + (href.match(/\?/) ? "&" : "?") + querystring; + const querystring = jQuery.param({"redirect_url": redirectUrl}); + return href + (href.match(/\?/) ? "&" : "?") + querystring; }); } }