From ca9fd95a08dd6fdfd69a60dbe53ac566be2d31df Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Mon, 29 Apr 2019 10:13:53 -0400 Subject: [PATCH] FIX: Respect "open external links in new window" in quotes and edit history --- .../javascripts/discourse/components/links-redirect.js.es6 | 4 ++-- app/assets/javascripts/discourse/lib/click-track.js.es6 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/discourse/components/links-redirect.js.es6 b/app/assets/javascripts/discourse/components/links-redirect.js.es6 index fdb5c11a48..84d5f890f0 100644 --- a/app/assets/javascripts/discourse/components/links-redirect.js.es6 +++ b/app/assets/javascripts/discourse/components/links-redirect.js.es6 @@ -4,13 +4,13 @@ export default Ember.Component.extend({ didInsertElement() { this._super(...arguments); - this.$().on("click.discourse-redirect", "#revisions a", function(e) { + $(this.element).on("click.discourse-redirect", "a", function(e) { return ClickTrack.trackClick(e); }); }, willDestroyElement() { this._super(...arguments); - this.$().off("click.discourse-redirect", "#revisions a"); + $(this.element).off("click.discourse-redirect", "a"); } }); diff --git a/app/assets/javascripts/discourse/lib/click-track.js.es6 b/app/assets/javascripts/discourse/lib/click-track.js.es6 index d4d0e71f2e..4728abf088 100644 --- a/app/assets/javascripts/discourse/lib/click-track.js.es6 +++ b/app/assets/javascripts/discourse/lib/click-track.js.es6 @@ -18,8 +18,8 @@ export function isValidLink($link) { return false; } - // Do not track links in quotes or in elided part - if ($link.parents("aside.quote, .elided").length !== 0) { + // Do not track links in elided part + if ($link.parents(".elided").length !== 0) { return false; }