Opened 16 years ago

Closed 15 years ago

#2424 closed Bug (fixed)

API to destroy instances

Reported by: Frederico Caldeira Knabben Owned by:
Priority: Normal Milestone: CKEditor 3.0
Component: General Version: FCKeditor 2.6.3
Keywords: Confirmed Cc: Garry Yao

Description

There must be a way to easily remove editor instances from the page, completely freeing resources used by those instances. This feature should be able to restore the <textarea> replaced by the instance, or remove it together with the editor.

Change History (4)

comment:1 in reply to:  description Changed 16 years ago by Daniel F. Kudwien

Oww. I searched the past hours for a function in FCKeditor that does exactly this.

I am developing Wysiwyg API for Drupal (core), and all editors must be able to attach/detach cleanly from textareas, since the user is able to change the editor based on an external selector.

I'll try to work around this limitation now, but it would be beneficial for FCKeditor 2.6 if there were save() and remove() instance methods, similar to what other editors like TinyMCE provide.

comment:2 Changed 15 years ago by Daniel F. Kudwien

Version: FCKeditor 2.6.3

Any updates? A fix for this does not sound that complex. Drupal's Wysiwyg API does the following to achieve the desired result:

    var editor = FCKeditorAPI.GetInstance(params.field);
    if (editor) {
      $('#' + params.field).val(editor.GetXHTML()).show();
      $('#' + params.field + '___Config').remove();
      $('#' + params.field + '___Frame').remove();
      delete FCKeditorAPI.__Instances[params.field];
    }

comment:3 Changed 15 years ago by Garry Yao

Cc: Garry Yao added

comment:4 Changed 15 years ago by Frederico Caldeira Knabben

Resolution: fixed
Status: newclosed

The "destroy" function has been introduced in V3 for this.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy