Merge pull request #8991 from MrPetovan/task/restore-autocomplete-comment
Restore auto-complete in comment boxes beyond the first
This commit is contained in:
commit
b219677de5
1 changed files with 9 additions and 8 deletions
|
@ -202,16 +202,17 @@ function string2bb(element) {
|
||||||
// jQuery wrapper for yuku/old-textcomplete
|
// jQuery wrapper for yuku/old-textcomplete
|
||||||
// uses a local object directory to avoid recreating Textcomplete objects
|
// uses a local object directory to avoid recreating Textcomplete objects
|
||||||
$.fn.textcomplete = function (strategies, options) {
|
$.fn.textcomplete = function (strategies, options) {
|
||||||
if (!(this.data('textcompleteId') in textcompleteObjects)) {
|
return this.each(function () {
|
||||||
let editor = new Textcomplete.editors.Textarea(this.get(0));
|
let $this = $(this);
|
||||||
|
if (!($this.data('textcompleteId') in textcompleteObjects)) {
|
||||||
|
let editor = new Textcomplete.editors.Textarea($this.get(0));
|
||||||
|
|
||||||
this.data('textcompleteId', textcompleteObjects.length);
|
$this.data('textcompleteId', textcompleteObjects.length);
|
||||||
textcompleteObjects.push(new Textcomplete(editor, options));
|
textcompleteObjects.push(new Textcomplete(editor, options));
|
||||||
}
|
}
|
||||||
|
|
||||||
textcompleteObjects[this.data('textcompleteId')].register(strategies);
|
textcompleteObjects[$this.data('textcompleteId')].register(strategies);
|
||||||
|
});
|
||||||
return this;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue