From 571c72f85334cef380098782cce3da91f7a9b238 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 12 Apr 2016 11:55:50 +0200 Subject: improve bbco autocomplete to not execute listNewLineAutocomplete() many times after many ajax page reloads --- view/js/autocomplete.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'view') diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js index a4a1fdf51..59e3600b3 100644 --- a/view/js/autocomplete.js +++ b/view/js/autocomplete.js @@ -314,9 +314,10 @@ function string2bb(element) { a.on('textComplete:select', function(e, value, strategy) { value; }); - $(this).keypress(function(e){ + a.keypress(function(e){ + e.stopImmediatePropagation(); if (e.keyCode == 13) { - x = listNewLineAutocomplete(this.id); + var x = listNewLineAutocomplete(this.id); if(x) e.preventDefault(); } -- cgit v1.2.3