2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

fhemweb.js: Open link only in new tab if shift/ctrl/etc is pressed

git-svn-id: https://svn.fhem.de/fhem/trunk@9028 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2015-08-08 11:46:59 +00:00
parent 4f508166dc
commit dd0c803593

View File

@ -354,7 +354,9 @@ FW_replaceLink(el)
if(ma == null || ma.length == 0 || !ma[2].match(/=(save|set)/)) { if(ma == null || ma.length == 0 || !ma[2].match(/=(save|set)/)) {
ma = attr.match(new RegExp("^"+FW_root)); // Avoid "Connection lost" @iOS ma = attr.match(new RegExp("^"+FW_root)); // Avoid "Connection lost" @iOS
if(ma) { if(ma) {
$(el).click(function() { $(el).click(function(e) {
if(e.shiftKey || e.ctrlKey || e.metaKey) // Open link in window/tab
return;
FW_leaving = 1; FW_leaving = 1;
if($(el).attr("target") == "_blank") { if($(el).attr("target") == "_blank") {
window.open(url, '_blank').focus(); window.open(url, '_blank').focus();