In our application we are loading a ckeditor-enabled #text_format field with ajax. However, the Drupal.behaviors.ckeditor behavior has no detach method, causing some errors in the vain of "i.contentWindow is not defined' when subsequently reloading the field with the same id.

I added this detach method, which seems to solve the issues we encountered so far:

detach:
        function (context) {
          $("textarea.ckeditor-mod.ckeditor-processed").each(function () {
            var ta_id=$(this).attr("id");
            Drupal.ckeditorOff(ta_id);
          }).removeClass('ckeditor-processed');
        }

Comments

dczepierga’s picture

Status: Active » Fixed
Issue tags: +D7, +#d7ux, +ckeditor-7.x

Detach method was added yesterday to DEV version... I add some things from your patch.

I commit it to CVS. Really thx for patch.

Greetings

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

mkesicki’s picture

Title: no detach in Drupal.behaviors.ckeditor » no detach method in Drupal.behaviors.ckeditor
mkesicki’s picture

Title: no detach method in Drupal.behaviors.ckeditor » No detach method in Drupal.behaviors.ckeditor