includes/clientside/tinymce/plugins/fullscreen/fullscreen.htm
changeset 476 f26a69c40431
parent 459 31c23016ab62
child 588 20484deb89cd
--- a/includes/clientside/tinymce/plugins/fullscreen/fullscreen.htm	Thu Mar 06 20:45:46 2008 -0500
+++ b/includes/clientside/tinymce/plugins/fullscreen/fullscreen.htm	Thu Mar 06 20:47:11 2008 -0500
@@ -64,9 +64,6 @@
 			window.close();
 		}
 
-		// Add onunload
-		tinymce.dom.Event.add(window, "beforeunload", unloadHandler);
-
 		function doParentSubmit() {
 			moveContent();
 
@@ -77,6 +74,27 @@
 
 			return false;
 		}
+
+		function render() {
+			var e = document.getElementById('fullscreenarea'), vp, ed, ow, oh, dom = tinymce.DOM;
+
+			e.value = window.opener.tinyMCE.activeEditor.getContent();
+
+			vp = dom.getViewPort();
+			settings.width = vp.w;
+			settings.height = vp.h - 15;
+
+			tinymce.dom.Event.add(window, 'resize', function() {
+				var vp = dom.getViewPort();
+
+				tinyMCE.activeEditor.theme.resizeTo(vp.w, vp.h);
+			});
+
+			tinyMCE.init(settings);
+		}
+
+		// Add onunload
+		tinymce.dom.Event.add(window, "beforeunload", unloadHandler);
 	</script>
 	<base target="_self" />
 </head>
@@ -86,11 +104,7 @@
 </form>
 
 <script type="text/javascript">
-		var e = document.getElementById('fullscreenarea');
-		e.value = window.opener.tinyMCE.activeEditor.getContent();
-		settings.width = window.innerWidth || document.body.clientWidth;
-		settings.height = (window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight) - 18;
-		tinyMCE.init(settings);
+	render();
 </script>
 
 </body>