Skip to content

Node.js based forum software built for the modern web

Revert "fix: early button/anchor clicks do nothing"

Barış Soner Uşaklıa395324b52a9
diff --git a/public/src/app.js b/public/src/app.js
index 1b987757b9..ed25c592d9 100644
--- a/public/src/app.js
+++ b/public/src/app.js
@@ -17,32 +17,6 @@ app.cacheBuster = null;
app.cacheBuster = config['cache-buster'];
- /**
- * Occasionally, a button or anchor (not meant to be ajaxified) is clicked before
- * ajaxify is ready. Capture that event and re-click it once NodeBB is ready.
- *
- * e.g. New Topic/Reply, post tools
- */
- var earlyQueue = []; // once we can ES6, use Set instead
- var earlyClick = function (ev) {
- var btnEl = ev.target.closest('button');
- if (!btnEl && ev.target.closest('a') && ev.target.closest('a').getAttribute('data-ajaxify') === 'false') {
- btnEl = ev.target.closest('a');
- }
- if (btnEl && !earlyQueue.includes(btnEl)) {
- earlyQueue.push(btnEl);
- ev.stopImmediatePropagation();
- ev.preventDefault();
- }
- };
- document.body.addEventListener('click', earlyClick);
- $(window).on('action:ajaxify.end', function () {
- document.body.removeEventListener('click', earlyClick);
- earlyQueue.forEach(function (el) {
- el.click();
- });
- });
-
bootbox.setDefaults({
locale: config.userLang,
});