fix: detecting when ctrl is pressed.

to enable users to open link in another tab.
This commit is contained in:
Laerte Pereira 2020-05-14 22:00:13 -03:00 committed by GitHub
parent 47551b47d5
commit 4d617bfffb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,9 +43,13 @@ Liberapay.init = function() {
Liberapay.s3_uploader_init();
Liberapay.stripe_init();
$('div[href]').css('cursor', 'pointer').click(function() {
location.href = this.getAttribute('href');
return false;
$('div[href]').css('cursor', 'pointer').click(function(event) {
let url = this.getAttribute('href');
if(event.ctrlKey) {
window.open(url);
} else {
location.href = url;
}
});
$('.navbar .dropdown-hover').removeClass('dropdown-hover');