Skip to content
Snippets Groups Projects
Commit ec57db45 authored by Phil Höfer's avatar Phil Höfer
Browse files

Allow Use of Ctrl Key to Open In New Tab

parent b4771fc3
No related branches found
No related tags found
3 merge requests!1895Development,!1747Development,!1742Resolve "Opening in New Tab"
...@@ -5,11 +5,11 @@ $(document).ready(function () { ...@@ -5,11 +5,11 @@ $(document).ready(function () {
}); });
function botProtection() { function botProtection() {
$('.result').find('a').click(function () { $('.result').find('a').click(function (e) {
var link = $(this).attr('href'); var link = $(this).attr('href');
var newtab = false; var newtab = false;
var top = false; var top = false;
if ($(this).attr('target') == '_blank') { if ($(this).attr('target') == '_blank' || e.ctrlKey) {
newtab = true; newtab = true;
} else if ($(this).attr('target') == "_top") { } else if ($(this).attr('target') == "_top") {
top = true; top = true;
...@@ -30,12 +30,11 @@ function botProtection() { ...@@ -30,12 +30,11 @@ function botProtection() {
} else { } else {
document.location.href = link; document.location.href = link;
} }
} else {
window.open(link, '_blank');
} }
}); });
if (!newtab) return false;
return false;
else
return true;
}); });
} }
...@@ -135,4 +134,4 @@ function loadMoreResults() { ...@@ -135,4 +134,4 @@ function loadMoreResults() {
}); });
} }
}, 1000); }, 1000);
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment