Skip to content

Commit

Permalink
added: target blank behaviour can be forced on an anchor
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalsem committed Dec 4, 2024
1 parent 532dcf2 commit 7d661c5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion views/default/target_blank/target_blank.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ if (site_url.substring(0, 1) === 's') {
}

var selector = 'a[href^="http://"]:not([target], [href^="http' + site_url + '"], [href^="https' + site_url + '"]),';
selector += 'a[href^="https://"]:not([target], [href^="http' + site_url + '"], [href^="https' + site_url + '"])';
selector += 'a[href^="https://"]:not([target], [href^="http' + site_url + '"], [href^="https' + site_url + '"]),';
selector += 'a[data-target-blank-suffix]';

$(document).on('click', selector, function () {
$(this).attr('target', '_blank');
Expand Down

0 comments on commit 7d661c5

Please sign in to comment.