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

Cloning DOM element which is the el for a wysihtml5 instance #321

Open
steinbachr opened this issue Dec 21, 2013 · 0 comments
Open

Cloning DOM element which is the el for a wysihtml5 instance #321

steinbachr opened this issue Dec 21, 2013 · 0 comments

Comments

@steinbachr
Copy link

Great plugin! I have one small issue though. I need to clone a DOM element which contains an element I initialized a wysihtml5 instance with:

$('.target textarea').wysihtml5()

so I then do something like:

/* I need a deep clone */
var newContainer = $('.target').clone(true, true);

however, the textarea in the new container now has a textarea which is uneditable and doesn't include the value of the original text area.

I've tried to manually set the value of the editor in the new container using

newContainer.find('textarea').data('wysihtml5').editor.setValue('foo');

but this just sets the value of the original editor. I've also tried just creating a new instance of wysihtml5 on the textarea in the new container but that doesn't resolve the problem either. Any suggestions?

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

1 participant