mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 09:17:30 +08:00
Fix: Cancel link click if triggered as part of text selection
Prevent a click if the user select content in a topic and release the mouse over a link. https://meta.discourse.org/t/selecting-a-link-results-in-it-being-opened/14846
This commit is contained in:
parent
46d8db3d70
commit
13cedce0cf
|
@ -14,6 +14,7 @@ Discourse.ClickTrack = {
|
|||
@param {jQuery.Event} e The click event that occurred
|
||||
**/
|
||||
trackClick: function(e) {
|
||||
if (Discourse.Utilities.selectedText()!=="") return false; //cancle click if triggered as part of selection.
|
||||
var $link = $(e.currentTarget);
|
||||
if ($link.hasClass('lightbox')) return true;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user