diff options
author | Aleksander Machniak <alec@alec.pl> | 2013-11-23 09:38:02 +0100 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2013-11-23 09:38:02 +0100 |
commit | 7184b3a0e14c81e0e582052aff64f030f07699e6 (patch) | |
tree | 034886f06f952873aeda663cfc60ff8ba5df944b /program/js/tiny_mce/plugins/fullscreen/fullscreen.htm | |
parent | 184a11b4fb35dae46366adba580e7d99ac457781 (diff) |
- Update TinyMCE to version 3.5.10 (#1489442)
Diffstat (limited to 'program/js/tiny_mce/plugins/fullscreen/fullscreen.htm')
-rw-r--r-- | program/js/tiny_mce/plugins/fullscreen/fullscreen.htm | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/program/js/tiny_mce/plugins/fullscreen/fullscreen.htm b/program/js/tiny_mce/plugins/fullscreen/fullscreen.htm index ffe528e41..baf028b79 100644 --- a/program/js/tiny_mce/plugins/fullscreen/fullscreen.htm +++ b/program/js/tiny_mce/plugins/fullscreen/fullscreen.htm @@ -46,7 +46,7 @@ settings['strict_loading_mode'] = true;
settings.save_onsavecallback = function() {
- window.opener.tinyMCE.get(oeID).setContent(tinyMCE.get('fullscreenarea').getContent({format : 'raw'}), {format : 'raw'});
+ moveContent();
window.opener.tinyMCE.get(oeID).execCommand('mceSave');
window.close();
};
@@ -56,11 +56,15 @@ }
function moveContent() {
- window.opener.tinyMCE.get(oeID).setContent(tinyMCE.activeEditor.getContent());
+ // find the original editor, execute restore state in it's plugin instance
+ window.opener.tinyMCE.get(oeID).plugins.fullscreen.saveState(tinyMCE.activeEditor);
+
+ // prevent moveContent from being called twice - e.g. if the unloadHandler runs after moveContent()
+ tinymce.dom.Event.remove(window, "beforeunload", unloadHandler);
}
function closeFullscreen() {
- moveContent();
+ // moveContent() will be called by the unload handler
window.close();
}
@@ -78,17 +82,20 @@ function render() {
var e = document.getElementById('fullscreenarea'), vp, ed, ow, oh, dom = tinymce.DOM;
- e.value = window.opener.tinyMCE.get(oeID).getContent();
-
vp = dom.getViewPort();
settings.width = vp.w;
settings.height = vp.h - 15;
- tinymce.dom.Event.add(window, 'resize', function() {
- var vp = dom.getViewPort();
+ settings.oninit = function() {
+ var ed = tinyMCE.activeEditor;
+ window.opener.tinyMCE.get(oeID).plugins.fullscreen.loadState(ed);
+
+ tinymce.dom.Event.add(window, 'resize', function() {
+ var vp = dom.getViewPort();
- tinyMCE.activeEditor.theme.resizeTo(vp.w, vp.h);
- });
+ tinyMCE.activeEditor.theme.resizeTo(vp.w, vp.h);
+ });
+ }
tinyMCE.init(settings);
}
|