mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-05-19 17:34:10 +02:00
Fix ctrl+clicking on regular links causing them to open twice
Closes #21
This commit is contained in:
parent
15a39de939
commit
2ecbbdd011
@ -167,10 +167,10 @@
|
|||||||
|
|
||||||
if (!me.is(".link-complex") && !(rel === "mediaPreview" && me.closest("#open-modal").length === 0) && rel !== "list" && rel !== "user"){
|
if (!me.is(".link-complex") && !(rel === "mediaPreview" && me.closest("#open-modal").length === 0) && rel !== "list" && rel !== "user"){
|
||||||
$TD.openBrowser(me.attr("href"));
|
$TD.openBrowser(me.attr("href"));
|
||||||
|
onUrlOpened();
|
||||||
}
|
}
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
onUrlOpened();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
window.open = function(url){
|
window.open = function(url){
|
||||||
@ -179,18 +179,20 @@
|
|||||||
$TD.openBrowser(url);
|
$TD.openBrowser(url);
|
||||||
onUrlOpened();
|
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.
|
// Block: Expand shortened links on hover.
|
||||||
//
|
//
|
||||||
|
Loading…
Reference in New Issue
Block a user