Opened 10 years ago

Closed 10 years ago

#5727 closed Bug (invalid)

Problem creating and destroying instances

Reported by: vurentjie Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Confirmed Cc:

Description

I found a problem creating and destroying the editor,

Firebug gave the error m.element is not defined on line 124 of the minified ckeditor.js (the editor's destroy method) which has the following :

if(m.elementMode==1)m.element.show();

I added the following

if(m.elementMode==1 && m.element)m.element.show();

this corrected the issue.

Attachments (1)

ckbug.html (6.1 KB) - added by vurentjie 10 years ago.
a html that will help reproduce the error, will need to relink the jquery and ckeditor.js files

Download all attachments as: .zip

Change History (3)

Changed 10 years ago by vurentjie

Attachment: ckbug.html added

a html that will help reproduce the error, will need to relink the jquery and ckeditor.js files

comment:1 Changed 10 years ago by Frederico Caldeira Knabben

Keywords: Confirmed added; destroy removed

This one is much probably related to #5441.

comment:2 Changed 10 years ago by Alfonso Martínez de Lizarrondo

Resolution: invalid
Status: newclosed

The cancel button is calling "editor.destroy();", but it isn't clearing the editor variable, so when a new editor is created, it tries again to destroy the previous instance:

if(editor)editor.destroy();
}}}}

This fixes the problem:
{{{
				var cancelButton=$('<input type="button" value="Cancel" />').click(function(){				
					
					/*for(var i in editor){
					
					if(typeof editor[i]=='function')alert(i+':'+editor[i]);
					
					}*/
					options.remove();
					
					editor.destroy();
					editor = null;
				});
}}}
Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy