Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions mention/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,15 @@
this.editor.focus();
var selection = this.editor.dom.select('span#autocomplete')[0];
this.editor.dom.remove(selection);
this.editor.execCommand('mceInsertContent', false, this.insert(item));

//GET THE INSERT CONTENT
var insertContent = this.insert(item);

//IF THE INSERT CONTENT ISNT A PROMIS INSERTT AS NORMAL
if(!insertContent instanceof Promise) this.editor.execCommand('mceInsertContent', false, insertContent);

//THE INSERT CONTENT IS A PROMISE
else insertContent.then((data) => this.editor.execCommand('mceInsertContent', false, data));
},

insert: function (item) {
Expand Down Expand Up @@ -414,4 +422,4 @@

tinymce.PluginManager.add('mention', tinymce.plugins.Mention);

});
});
2 changes: 1 addition & 1 deletion mention/plugin.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.