开发者

How to trigger TinyMCE iframe creation/init in drupal/jQuery site for moved/cloned iframe

开发者 https://www.devze.com 2022-12-21 06:35 出处:网络
I am working on a jQuery-based plugin as a drupal module that will tweak the comment form for a content type so that it appears inline on clicking certain content. When I try to clone() the comment fo

I am working on a jQuery-based plugin as a drupal module that will tweak the comment form for a content type so that it appears inline on clicking certain content. When I try to clone() the comment form and append it to a hidden div so that I can access it later, the TinyMCE iframe does not come with the cloning, so I'm left with an empty iframe which I cannot enter text into.

I've tried to go into the iframe contentDocument and individually clone the child elements, but that hasn't worked. I've also tried to rearrange the module load order by altering the weight field in the drupal system table, so that my JS loads before the WYSIWYG module and TinyMCE library JS, but haven't been able to change the module load order either. I even used the Util drupal module to change modules weights with no luck. Any ideas on how to get a functioning TinyMCE开发者_如何学运维 iframe within a cloned div?

Thanks, Dakota


If you don't load the js for tinyMCE you can do your DOM manipulations first and then load the tinyMCE js with your own js. I haven't tested this and looked into how tinyMCE does things. But if you want your script to run first, that solution should work.

0

精彩评论

暂无评论...
验证码 换一张
取 消