mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
FIX: erratic behaviour when clicking an attachment link
This commit is contained in:
parent
8c930c97e0
commit
ad3d2269b2
1 changed files with 8 additions and 7 deletions
|
@ -73,6 +73,14 @@ export default {
|
|||
$link.data('auto-route', true);
|
||||
}
|
||||
|
||||
// restore href
|
||||
setTimeout(() => {
|
||||
$link.removeClass('no-href');
|
||||
$link.attr('href', $link.data('href'));
|
||||
$link.data('href', null);
|
||||
return;
|
||||
}, 50);
|
||||
|
||||
// warn the user if they can't download the file
|
||||
if (Discourse.SiteSettings.prevent_anons_from_downloading_files && $link.hasClass("attachment") && !Discourse.User.current()) {
|
||||
bootbox.alert(I18n.t("post.errors.attachment_download_requires_login"));
|
||||
|
@ -94,13 +102,6 @@ export default {
|
|||
return false;
|
||||
}
|
||||
|
||||
// restore href
|
||||
setTimeout(function() {
|
||||
$link.removeClass('no-href');
|
||||
$link.attr('href', $link.data('href'));
|
||||
$link.data('href', null);
|
||||
}, 50);
|
||||
|
||||
// Otherwise, use a custom URL with a redirect
|
||||
if (Discourse.User.currentProp('external_links_in_new_tab')) {
|
||||
var win = window.open(trackingUrl, '_blank');
|
||||
|
|
Loading…
Reference in a new issue