Skip to content

Node.js based forum software built for the modern web

closes #4826

Julian Lam81a4103d64d8
diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js
index f7cbe1c26b..b4ad44e51b 100644
--- a/public/src/ajaxify.js
+++ b/public/src/ajaxify.js
@@ -304,6 +304,8 @@ $(document).ready(function() {
return href === undefined || href === '' || href === 'javascript:;';
}
+ var contentEl = document.getElementById('content');
+
// Enhancing all anchors to ajaxify...
$(document.body).on('click', 'a', function (e) {
var _self = this;
@@ -321,7 +323,7 @@ $(document).ready(function() {
}
}
} else if (window.location.pathname !== '/outgoing') {
- if (config.openOutgoingLinksInNewTab) {
+ if (config.openOutgoingLinksInNewTab && $.contains(contentEl, this)) {
window.open(this.href, '_blank');
e.preventDefault();
} else if (config.useOutgoingLinksPage) {