Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Save TinyMCE under AJAX

  • Loading branch information...
commit c2965bc88ddfa031c0f0b08904cb5bfb20d1371c 1 parent 9c370ad
@vrana authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 plugins/tinymce.php
View
10 plugins/tinymce.php
@@ -67,7 +67,15 @@ function selectVal(&$val, $link, $field) {
function editInput($table, $field, $attrs, $value) {
if (ereg("text", $field["type"]) && ereg("_html", $field["field"])) {
- return "<textarea$attrs id='fields-" . h($field["field"]) . "' rows='12' cols='50'>" . h($value) . "</textarea><script type='text/javascript'>tinyMCE.execCommand('mceAddControl', true, 'fields-" . js_escape($field["field"]) . "');</script>";
+ return "<textarea$attrs id='fields-" . h($field["field"]) . "' rows='12' cols='50'>" . h($value) . "</textarea><script type='text/javascript'>
+tinyMCE.remove(tinyMCE.get('fields-" . js_escape($field["field"]) . "') || { });
+tinyMCE.execCommand('mceAddControl', true, 'fields-" . js_escape($field["field"]) . "');
+document.getElementById('form').onsubmit = function () {
+ tinyMCE.each(tinyMCE.editors, function (ed) {
+ ed.remove();
+ });
+};
+</script>";
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.