Skip to content

Commit

Permalink
fix: npm lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rsdeus committed Oct 16, 2024
1 parent 2517005 commit 7b63165
Showing 1 changed file with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ $(() => {
$(document).on("click.zf.trigger", (event) => {
// Try to get the <a> directly or find the closest parent <a>
let $target = $(event.target);
if (!$target.is('a')) {
$target = $target.closest('a'); // Find the closest parent <a> if the click is not directly on an <a>
if (!$target.is("a")) {
// Find the closest parent <a> if the click is not directly on an <a>
$target = $target.closest("a");
}

// Check if an <a> was found
Expand All @@ -65,15 +66,15 @@ $(() => {
const redirectUrl = $target.data("redirectUrl");

if (dialogTarget && redirectUrl) {
$("<input type='hidden' />")
.attr("id", "redirect_url")
.attr("name", "redirect_url")
.attr("value", redirectUrl)
.appendTo(`${dialogTarget} form`);
$("<input type='hidden' />").
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;
});
}
}
Expand Down

0 comments on commit 7b63165

Please sign in to comment.