jquery-mentions icon indicating copy to clipboard operation
jquery-mentions copied to clipboard

applying to textarea that is dynamically added to a page

Open nicksterFL opened this issue 8 years ago • 2 comments

anyway to bind the mentionsInput to a textarea that is dynamically added to the dom?

nicksterFL avatar Feb 15 '17 20:02 nicksterFL

just call the plugin right after you added textarea to the dom

ivirabyan avatar Feb 16 '17 14:02 ivirabyan

We do something similar to:

<div id="content_1">
This is example content.
<a href="/contents/1/edit.js" data-remote="true">Edit</a>
</div>
//contents/1/edit.js

$('#content_1').replaceWith('<div id="content_1_edit"><textarea class="mention"></textarea></div>');
$('.mention').mentionsInput({ source: '/users.json' });

Let's think about it like inline editing.

It does not work. I am not able to use @mention in the newest textarea.

lukaszsliwa avatar Jun 30 '17 21:06 lukaszsliwa