--- nicedit.js.o Fri Feb 25 01:08:00 2011 +++ nicedit.js Thu May 5 11:18:41 2011 @@ -4,12 +4,22 @@ * Attach this editor to a target element. */ Drupal.wysiwyg.editor.attach.nicedit = function(context, params, settings) { + // Intercept and ignore submit handlers or they will revert changes made + // since the instance was removed, and they can't be referenced once set. + // The same operations are performed when the instance is removed anyway. + var oldAddEvent = bkLib.addEvent; + bkLib.addEvent = function(obj, type, fn) { + if (type != 'submit') { + oldAddEvent(obj, type, fn); + } + } // Attach editor. var editor = new nicEditor(settings); editor.panelInstance(params.field); editor.addEvent('focus', function () { Drupal.wysiwyg.activeId = params.field; }); + bkLib.addEvent = oldAddEvent; }; /**