Message info
 
To:wp-svn@lists.automattic.com From:m@wordpress.org Subject:[wp-svn] [20804] trunk/wp-includes/js/tinymce/plugins/wpfullscreen: DFW: another attempt to get auto-resize working right, see #20608, see #20684 Date:Wed, 16 May 2012 07:02:55 +0000 (UTC)
 

Revision
20804
Author
azaozz
Date
2012-05-16 07:02:55 +0000 (Wed, 16 May 2012)

Log Message

DFW: another attempt to get auto-resize working right, see #20608, see #20684

Modified Paths

Diff

Modified: trunk/wp-includes/js/tinymce/plugins/wpfullscreen/css/wp-fullscreen.css (20803 => 20804)


--- trunk/wp-includes/js/tinymce/plugins/wpfullscreen/css/wp-fullscreen.css	2012-05-16 05:58:24 UTC (rev 20803)
+++ trunk/wp-includes/js/tinymce/plugins/wpfullscreen/css/wp-fullscreen.css	2012-05-16 07:02:55 UTC (rev 20804)
@@ -1,11 +1,13 @@
 /*
 Distraction Free Writing mode TinyMCE Styles
 */
-
-html, body {
+
+html,
+body {
 	background: transparent;
 	width: auto !important;
 	max-width: none !important;
-	margin: 0;
-	padding: 0;
+	margin: 0 !important;
+	padding: 0 !important;
+	min-height: 0 !important;
 }

Modified: trunk/wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin_src.js (20803 => 20804)


--- trunk/wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin_src.js	2012-05-16 05:58:24 UTC (rev 20803)
+++ trunk/wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin_src.js	2012-05-16 07:02:55 UTC (rev 20804)
@@ -8,7 +8,7 @@
 	tinymce.create('tinymce.plugins.wpFullscreenPlugin', {
 
 		init : function(ed, url) {
-			var t = this, oldHeight = 0, s = {}, DOM = tinymce.DOM, resized = false;
+			var t = this, oldHeight = 0, s = {}, DOM = tinymce.DOM;
 
 			// Register commands
 			ed.addCommand('wpFullScreenClose', function() {
@@ -112,26 +112,22 @@
 			 * This method gets executed each time the editor needs to resize.
 			 */
 			function resize() {
-				if ( resized )
-					return;
-
 				var d = ed.getDoc(), DOM = tinymce.DOM, resizeHeight, myHeight;
 
 				// Get height differently depending on the browser used
-				if ( tinymce.isIE || tinymce.isWebKit )
-					myHeight = d.body.scrollHeight;
-				else
+				if ( tinymce.isWebKit )
 					myHeight = d.body.offsetHeight;
+				else
+					myHeight = d.body.scrollHeight;
 
 				// Don't make it smaller than 300px
 				resizeHeight = (myHeight > 300) ? myHeight : 300;
 
 				// Resize content element
 				if ( oldHeight != resizeHeight ) {
-					resized = true;
-					setTimeout(function(){ resized = false; }, 100);
 					DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px');
 					oldHeight = resizeHeight;
+					ed.getWin().scrollTo(0,0);
 				}
 			};