1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-05-03 23:34:09 +02:00

Fix ctrl+clicking on regular links causing them to open twice

Closes 
This commit is contained in:
chylex 2016-04-26 20:22:03 +02:00
parent 15a39de939
commit 2ecbbdd011

View File

@ -167,10 +167,10 @@
if (!me.is(".link-complex") && !(rel === "mediaPreview" && me.closest("#open-modal").length === 0) && rel !== "list" && rel !== "user"){
$TD.openBrowser(me.attr("href"));
onUrlOpened();
}
e.preventDefault();
onUrlOpened();
});
window.open = function(url){
@ -179,18 +179,20 @@
$TD.openBrowser(url);
onUrlOpened();
};
TD.util.maybeOpenClickExternally = prependToFunction(TD.util.maybeOpenClickExternally,function(e){
if (e.ctrlKey){
if (urlWait)return;
$TD.openBrowser(e.currentTarget.getAttribute("href"));
e.preventDefault();
e.stopPropagation();
e.stopImmediatePropagation();
return true;
}
});
})();
TD.util.maybeOpenClickExternally = prependToFunction(TD.util.maybeOpenClickExternally,function(e){
if (e.ctrlKey){
$TD.openBrowser(e.currentTarget.getAttribute("href"));
e.preventDefault();
e.stopPropagation();
e.stopImmediatePropagation();
return true;
}
});
//
// Block: Expand shortened links on hover.
//