Skip to content

A platform for community discussion. Free, open, simple.

FIX: Respect "open external links in new window" in quotes and edit history

Penar Musarajca9fd95a08dd
diff --git a/app/assets/javascripts/discourse/components/links-redirect.js.es6 b/app/assets/javascripts/discourse/components/links-redirect.js.es6
index fdb5c11a487..84d5f890f0c 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 d4d0e71f2ee..4728abf0884 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;
}