mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 04:34:13 -06:00
FIX: Do not track right clicks. (#6530)
This commit is contained in:
parent
6a3767cde7
commit
2a77550f8c
@ -13,6 +13,11 @@ export function isValidLink($link) {
|
||||
|
||||
export default {
|
||||
trackClick(e) {
|
||||
// right clicks are not tracked
|
||||
if (e.which === 3) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// cancel click if triggered as part of selection.
|
||||
if (selectedText() !== "") {
|
||||
return false;
|
||||
|
@ -69,6 +69,12 @@ QUnit.test("does not track clicks on back buttons", assert => {
|
||||
assert.ok(track(generateClickEventOn(".back")));
|
||||
});
|
||||
|
||||
QUnit.test("does not track right clicks inside quotes", assert => {
|
||||
const event = generateClickEventOn(".quote a:first-child");
|
||||
event.which = 3;
|
||||
assert.ok(track(event));
|
||||
});
|
||||
|
||||
QUnit.test("does not track clicks to internal links in quotes", assert => {
|
||||
sandbox.stub(DiscourseURL, "routeTo");
|
||||
sandbox.stub(DiscourseURL, "origin").returns("http://discuss.domain.com");
|
||||
|
Loading…
Reference in New Issue
Block a user