From f3554804bfe5bf88984bce925470934429567516 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 14 Jan 2019 10:14:37 +0100 Subject: only load new content onpopstate if the mid has actually changed --- view/tpl/notifications_widget.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'view') diff --git a/view/tpl/notifications_widget.tpl b/view/tpl/notifications_widget.tpl index 98047f1d9..bc7f80906 100644 --- a/view/tpl/notifications_widget.tpl +++ b/view/tpl/notifications_widget.tpl @@ -24,7 +24,7 @@ }); window.onpopstate = function(e) { - if(e.state !== null) + if(e.state !== null && e.state.b64mid !== bParam_mid) getData(e.state.b64mid, ''); }; }); -- cgit v1.2.3 From 7daf18b0771abbc483edf3e85c30c5df8bc82839 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 14 Jan 2019 14:07:56 +0100 Subject: fix a new instance of autocomplete created on each conversation update --- view/js/main.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'view') diff --git a/view/js/main.js b/view/js/main.js index ca9ad8ca4..017d39353 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -44,6 +44,17 @@ $(document).ready(function() { $(document).on('click', '.conversation-settings-link', getConversationSettings); $(document).on('click', '#settings_module_ajax_submit', postConversationSettings); + $(document).on('click focus', '.comment-edit-form textarea', function(e) { + if(! this.autocomplete_handled) { + /* autocomplete @nicknames */ + $(this).editor_autocomplete(baseurl+"/acl?f=&n=1"); + /* autocomplete bbcode */ + $(this).bbco_autocomplete('bbcode'); + + this.autocomplete_handled = true; + } + }); + var tf = new Function('n', 's', 'var k = s.split("/")['+aStr['plural_func']+']; return (k ? k : s);'); jQuery.timeago.settings.strings = { @@ -755,11 +766,6 @@ function updateConvItems(mode,data) { mediaPlaying = false; }); - /* autocomplete @nicknames */ - $(".comment-edit-form textarea").editor_autocomplete(baseurl+"/acl?f=&n=1"); - /* autocomplete bbcode */ - $(".comment-edit-form textarea").bbco_autocomplete('bbcode'); - var bimgs = ((preloadImages) ? false : $(".wall-item-body img").not(function() { return this.complete; })); var bimgcount = bimgs.length; -- cgit v1.2.3 From c26e112bee8c57c2a9d7d5f6f24ddca8de033c19 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 14 Jan 2019 15:06:21 +0100 Subject: whitespace --- view/js/autocomplete.js | 2 -- 1 file changed, 2 deletions(-) (limited to 'view') diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js index 6b77f0631..278a0a176 100644 --- a/view/js/autocomplete.js +++ b/view/js/autocomplete.js @@ -216,8 +216,6 @@ function string2bb(element) { }); textcomplete.register([contacts,forums,smilies,tags]); }); - - }; })( jQuery ); -- cgit v1.2.3