Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

Commit

Permalink
saving tinymce content
Browse files Browse the repository at this point in the history
  • Loading branch information
garbas committed Jun 30, 2012
1 parent 0041ba7 commit 3593b5d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plone/app/toolbar/resources/src/plone.init.js
Expand Up @@ -70,7 +70,7 @@ $.plone.init.register(function(context) {
$(el).attr('id', id);

var config = new TinyMCEConfig(id);
//delete InitializedTinyMCEInstances[id];
delete InitializedTinyMCEInstances[id];
config.init();

});
Expand Down
13 changes: 12 additions & 1 deletion plone/app/toolbar/resources/src/plone.overlay.js
Expand Up @@ -120,6 +120,16 @@ $.plone.overlay.Overlay.prototype = {
},
form: 'form#form,form[name="edit_form"]',
form_options: {
beforeSerialize: function(form, options) {
// save tinymce text to textarea
var textarea = $('.mce_editable', form),
textarea_id = textarea.attr('id');
if (textarea.size() !== 0 &&
tinyMCE.editors[textarea_id] !== undefined) {
tinyMCE.editors[textarea_id].save()
tinyMCE.editors[textarea_id].remove();
}
},
success: function(response, state, xhr, form) {
var old_el = self._el,
response_body = $('<div/>').html(
Expand All @@ -132,6 +142,7 @@ $.plone.overlay.Overlay.prototype = {
}
old_el.remove();
self._init_el();
self.show();
} else {
if (self.options.save !== undefined) {
self.options.save.apply(self, [ response_body, state, xhr, form ]);
Expand Down Expand Up @@ -248,7 +259,7 @@ $.plone.overlay.Overlay.prototype = {
});
});

// initialize element
// initialize element's javascript widgets
self._el.appendTo($('body'));
self._el.ploneInit();

Expand Down

0 comments on commit 3593b5d

Please sign in to comment.