summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsun2010-02-06 15:27:36 (GMT)
committer sun2010-02-06 15:27:36 (GMT)
commit1f79650c33df1bf11b0dadafc6038cd382118198 (patch)
tree2f24ac60b04822b78ce9a7bbdd036eb5314132ad
parent2f497ebe9e5547fcaf764a8700d441d9813c0ab0 (diff)
#667848 by TwoD, kaakuu: Fixed FCKeditor is not properly detached in IE.
-rw-r--r--CHANGELOG.txt1
-rw-r--r--editors/js/fckeditor-2.6.js12
2 files changed, 11 insertions, 2 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index cd8505e..c7f09ff 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -6,6 +6,7 @@ Wysiwyg x.x-x.x, xxxx-xx-xx
Wysiwyg 6.x-3.x, xxxx-xx-xx
---------------------------
+#667848 by TwoD, kaakuu: Fixed FCKeditor is not properly detached in IE.
#695768 by sun: Fixed #resizable removed when no editor profiles are loaded.
#659194 by dkg: Changed YUI Editor should check the version in editor-min.js.
#631494 by TwoD: Fixed multi-site libraries directory failure for WYMeditor.
diff --git a/editors/js/fckeditor-2.6.js b/editors/js/fckeditor-2.6.js
index 9837d00..3806140 100644
--- a/editors/js/fckeditor-2.6.js
+++ b/editors/js/fckeditor-2.6.js
@@ -35,11 +35,19 @@ Drupal.wysiwyg.editor.detach.fckeditor = function(context, params) {
}
for (var instanceName in instances) {
- instances[instanceName].UpdateLinkedField();
+ var instance = instances[instanceName];
+ instance.UpdateLinkedField();
+ // Since we already detach the editor and update the textarea, the submit
+ // event handler needs to be removed to prevent data loss (in IE).
+ // FCKeditor uses 2 nested iFrames; instance.EditingArea.Window is the
+ // deepest. Its parent is the iFrame containing the editor.
+ var instanceScope = instance.EditingArea.Window.parent;
+ instanceScope.FCKTools.RemoveEventListener(instance.GetParentForm(), 'submit', instance.UpdateLinkedField);
+ // Remove the editor instance.
$('#' + instanceName + '___Config').remove();
$('#' + instanceName + '___Frame').remove();
$('#' + instanceName).show();
- delete instances[instanceName];
+ delete instance;
}
};