From 46ed610d041ccbcf5b2b9f42990b8df65094a4cc Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 27 Dec 2020 20:36:33 -0500 Subject: [PATCH] Restore auto-complete feature in comments forms - New catch-all feature supports network/display pages, infinite scroll and live updated conversations --- view/js/main.js | 15 +++++++++++---- view/templates/display-head.tpl | 11 ++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/view/js/main.js b/view/js/main.js index 175f68ca63..a0ffea3718 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -175,6 +175,17 @@ $(function() { $(textarea).trigger('change'); }); + $(".comment-edit-wrapper textarea, .wall-item-comment-wrapper textarea") + .editor_autocomplete(baseurl + '/search/acl') + .bbco_autocomplete('bbcode'); + + // Ensures asynchronously-added comment forms recognize mentions, tags and BBCodes as well + document.addEventListener("postprocess_liveupdate", function() { + $(".comment-edit-wrapper textarea, .wall-item-comment-wrapper textarea") + .editor_autocomplete(baseurl + '/search/acl') + .bbco_autocomplete('bbcode'); + }); + /* popup menus */ function close_last_popup_menu() { if (last_popup_menu) { @@ -568,10 +579,6 @@ function updateConvItems(data) { commentBusy = false; $('body').css('cursor', 'auto'); } - /* autocomplete @nicknames */ - $(".comment-edit-form textarea").editor_autocomplete(baseurl + '/search/acl'); - /* autocomplete bbcode */ - $(".comment-edit-form textarea").bbco_autocomplete('bbcode'); } function liveUpdate(src) { diff --git a/view/templates/display-head.tpl b/view/templates/display-head.tpl index aafa0d6988..732f06427b 100644 --- a/view/templates/display-head.tpl +++ b/view/templates/display-head.tpl @@ -1,13 +1,6 @@ {{if $alternate}} - + {{/if}} {{if $conversation}} - + {{/if}} -