diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-04-26 20:08:03 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-04-26 20:08:03 +0200 |
commit | baa46e105c99e057f4678f837a8ce20d3b8a580f (patch) | |
tree | 2206019e60a40888bcdbd62277ff334b22ce1ac7 /view/js/autocomplete.js | |
parent | 4e389b474a333f84e6b4180fe73a3d45264db859 (diff) | |
download | volse-hubzilla-baa46e105c99e057f4678f837a8ce20d3b8a580f.tar.gz volse-hubzilla-baa46e105c99e057f4678f837a8ce20d3b8a580f.tar.bz2 volse-hubzilla-baa46e105c99e057f4678f837a8ce20d3b8a580f.zip |
if there is more than one textarea we need to work through all of them
Diffstat (limited to 'view/js/autocomplete.js')
-rw-r--r-- | view/js/autocomplete.js | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js index 5fbdab27b..60552588e 100644 --- a/view/js/autocomplete.js +++ b/view/js/autocomplete.js @@ -231,10 +231,13 @@ function string2bb(element) { this.attr('autocomplete','off'); var Textarea = Textcomplete.editors.Textarea; - var editor = new Textarea(this[0]); - var textcomplete = new Textcomplete(editor); - textcomplete.register([contacts,forums,smilies,tags], {className:'acpopup', zIndex:1020}); + $(this).each(function() { + var editor = new Textarea(this); + var textcomplete = new Textcomplete(editor); + textcomplete.register([contacts,forums,smilies,tags], {className:'acpopup', zIndex:1020}); + }); + }; })( jQuery ); @@ -282,10 +285,11 @@ function string2bb(element) { this.attr('autocomplete', 'off'); var Textarea = Textcomplete.editors.Textarea; - var editor = new Textarea(this[0]); - var textcomplete = new Textcomplete(editor); - - textcomplete.register([contacts,forums,tags], {className:'acpopup', maxCount:100, zIndex: 1020, appendTo:'nav'}); + $(this).each(function() { + var editor = new Textarea(this); + var textcomplete = new Textcomplete(editor); + textcomplete.register([contacts,forums,tags], {className:'acpopup', maxCount:100, zIndex: 1020, appendTo:'nav'}); + }); this.on('select', function(e, value, strategy) { submit_form(this); }); }; @@ -313,10 +317,11 @@ function string2bb(element) { this.attr('autocomplete','off'); var Textarea = Textcomplete.editors.Textarea; - var editor = new Textarea(this[0]); - var textcomplete = new Textcomplete(editor); - - textcomplete.register([contacts], {className:'acpopup', zIndex:1020}); + $(this).each(function() { + var editor = new Textarea(this); + var textcomplete = new Textcomplete(editor); + textcomplete.register([contacts], {className:'acpopup', zIndex:1020}); + }); if(autosubmit) this.on('select', function(e,value,strategy) { submit_form(this); }); @@ -349,10 +354,12 @@ function string2bb(element) { this.attr('autocomplete','off'); var Textarea = Textcomplete.editors.Textarea; - var editor = new Textarea(this[0]); - var textcomplete = new Textcomplete(editor); - textcomplete.register([names], {className:'acpopup', zIndex:1020}); + $(this).each(function() { + var editor = new Textarea(this); + var textcomplete = new Textcomplete(editor); + textcomplete.register([names], {className:'acpopup', zIndex:1020}); + }); if(autosubmit) this.on('select', function(e,value,strategy) { submit_form(this); }); @@ -427,10 +434,12 @@ function string2bb(element) { this.attr('autocomplete','off'); var Textarea = Textcomplete.editors.Textarea; - var editor = new Textarea(this[0]); - var textcomplete = new Textcomplete(editor); - textcomplete.register([bbco], {className:'acpopup', zIndex:1020}); + $(this).each(function() { + var editor = new Textarea(this); + var textcomplete = new Textcomplete(editor); + textcomplete.register([bbco], {className:'acpopup', zIndex:1020}); + }); this.on('select', function(e, value, strategy) { value; }); |