Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

applying to textarea that is dynamically added to a page #75

Open
nicksterFL opened this issue Feb 15, 2017 · 2 comments
Open

applying to textarea that is dynamically added to a page #75

nicksterFL opened this issue Feb 15, 2017 · 2 comments

Comments

@nicksterFL
Copy link

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

@ivirabyan
Copy link
Owner

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

@ghost
Copy link

ghost commented Jun 30, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants