If the modal has no content then redirect to the permalink for the person (#902)

Signed-off-by: Chris Abraham <cjyabraham@gmail.com>
This commit is contained in:
Chris Abraham 2024-11-28 13:51:02 -08:00
parent 1da53b94d0
commit 16f1a84c9b
No known key found for this signature in database
GPG Key ID: 60A2BD1DA7D4B0F0
1 changed files with 5 additions and 0 deletions

View File

@ -95,6 +95,11 @@
$modal_code += $modal_content.html();
$modal_code += '</div>';
$modal_content.empty();
} else if ( $modal_slug !== '' ) {
// if no modal content but slug is defined, redirect the page to the permalink for this person.
var urlWithoutQueryString = window.location.origin + window.location.pathname;
window.location.href = urlWithoutQueryString + '?p=' + $modal_slug;
return;
}
$modal_code += '</div></div></' + $modal_tag + '>';