diff --git a/js/editor.js b/js/editor.js index 6b0deaf..ede994d 100644 --- a/js/editor.js +++ b/js/editor.js @@ -62,7 +62,10 @@ if (event.isDefaultPrevented()) { return; } - Drupal.editorDetach(field, Drupal.settings.editor.formats[activeEditor]); + // Detach the current editor (if any). + if (Drupal.settings.editor.formats[activeEditor]) { + Drupal.editorDetach(field, Drupal.settings.editor.formats[activeEditor], 'serialize'); + } }); }); },