From 8bfb5b4e7bea2ffb5662640ee0bcf6045001a50b Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 22 Feb 2016 16:39:43 -0500 Subject: [PATCH] Backported double click fix --- app/assets/javascripts/discourse/widgets/post-cooked.js.es6 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/widgets/post-cooked.js.es6 b/app/assets/javascripts/discourse/widgets/post-cooked.js.es6 index 19bb1a99f6..1847ca4710 100644 --- a/app/assets/javascripts/discourse/widgets/post-cooked.js.es6 +++ b/app/assets/javascripts/discourse/widgets/post-cooked.js.es6 @@ -89,10 +89,12 @@ export default class PostCooked { const $link = $(e); const href = $link.attr('href'); - let valid = !lc.internal && href === lc.url; + let valid = href === lc.url; // this might be an attachment - if (lc.internal) { valid = href.indexOf(lc.url) >= 0; } + if (lc.internal && /^\/uploads\//.test(lc.url)) { + valid = href.indexOf(lc.url) >= 0; + } // don't display badge counts on category badge & oneboxes (unless when explicitely stated) if (valid && isValidLink($link)) {