From ae35ac0cec3f6bf3373ff901dabe20f35ec1933a Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 3 May 2018 13:14:12 +0200 Subject: quick fix for issue #1150 - needs improvement and review of other textcomplete implementations. --- view/js/autocomplete.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'view') diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js index 60552588e..b7ebe3293 100644 --- a/view/js/autocomplete.js +++ b/view/js/autocomplete.js @@ -353,19 +353,22 @@ function string2bb(element) { this.attr('autocomplete','off'); + var aItem; var Textarea = Textcomplete.editors.Textarea; $(this).each(function() { var editor = new Textarea(this); var textcomplete = new Textcomplete(editor); textcomplete.register([names], {className:'acpopup', zIndex:1020}); + textcomplete.on('select', function() { aItem = textcomplete.dropdown.getActiveItem(); }); }); if(autosubmit) - this.on('select', function(e,value,strategy) { submit_form(this); }); + this.on('select', function() { submit_form(this); }); if(typeof onselect !== 'undefined') - this.on('select', function(e, value, strategy) { onselect(value); }); + this.on('select', function() { onselect(aItem.searchResult.data); }); + }; })( jQuery ); -- cgit v1.2.3