-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open new tab instead of redirect #39
Comments
Yeah this isn't a bad move @fleshmanj. Go ahead and make a PR and I'll review it. My only concern is the pop-up loading modal is a pet of mine, and I want it to remain. The logic for it is in search.js: const my_modal = new bootstrap.Modal(document.getElementById('exit-modal'), {focus: false});
$("#link-list a").on('click', function(event) {
$('#exit-modal .modal-header .title').text($(this).prop('title'));
$('#exit-modal .link').text($(this).prop('href'));
my_modal.toggle();
}); I'm thinking for UX:
We'll need to check for popup blocking, like: // Open window in background
const newWindow = window.open(url, '_blank', 'noopener');
if (newWindow) {
// Ensure the new window stays in background by focusing back on current window
window.focus();
// After delay, switch to new window and close modal
setTimeout(() => {
newWindow.focus();
my_modal.hide();
}, 2000);
} else {
// In case popup was blocked
$('#exit-modal .link').text('Please allow popups to open ' + url);
} And ideally close the modal when clicking outside the modal in case it gets stuck. |
If you want to test and build locally, you just need to:
You do need node and jekyll (ruby) installed. I use WSL on a windows machine personally. |
If you're interested, I am willing to add the feature. Otherwise, it's still great as is.
The text was updated successfully, but these errors were encountered: