Permalink
Browse files

MINOR Don't try to remove editor containers before they exist

  • Loading branch information...
1 parent 7f62ad0 commit f26951c63d4e86fcadb703cada1d552aad69770a @chillu chillu committed Apr 18, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 javascript/HtmlEditorField.js
@@ -245,8 +245,8 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
// TODO Move to onunmatch for less coupling (once we figure out how to work with detached DOM nodes in TinyMCE)
$('.cms-container').bind('beforestatechange', function() {
self.css('visibility', 'hidden');
- ed.getContainer();
- if(ed) $(ed).remove();
+ var container = ed.getInstance() ? ed.getContainer() : null;
+ if(container && container.length) container.remove();
});
this._super();

0 comments on commit f26951c

Please sign in to comment.