Skip to content

Commit 3843f78

Browse files
author
David-Julian BUCH
committed
Add reinit method
Reinit method in order to update Mentions if the textarea value was changed programmatically (for example, we loaded new Mentions markup in it)
1 parent c26b061 commit 3843f78

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

jquery.mentionsInput.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -538,11 +538,16 @@
538538
callback.call(this, mentionsCollection.length ? elmInputBox.data('messageText') : getInputBoxValue());
539539
},
540540

541-
//Resets the text area value and clears all mentions
541+
//Resets the text area value and clears all mentions
542542
reset : function () {
543543
resetInput();
544544
},
545545

546+
//Reinit with the text area value if it was changed programmatically
547+
reinit : function () {
548+
resetInput(false);
549+
},
550+
546551
//An async method which accepts a callback function and returns a collection of mentions as hash objects as a first parameter.
547552
getMentions : function (callback) {
548553
if (!_.isFunction(callback)) {

0 commit comments

Comments
 (0)