Index: src/wp-admin/js/editor-expand.js
===================================================================
--- src/wp-admin/js/editor-expand.js	(revision 30975)
+++ src/wp-admin/js/editor-expand.js	(working copy)
@@ -161,6 +161,16 @@
 				return;
 			}
 
+			editor.show = function() {
+				this.fire( 'beforeShow' );
+				Object.getPrototypeOf( editor ).show.apply( this, arguments );
+			};
+
+			editor.hide = function() {
+				this.fire( 'beforeHide' );
+				Object.getPrototypeOf( editor ).hide.apply( this, arguments );
+			};
+
 			// Copy the editor instance.
 			mceEditor = editor;
 
@@ -248,31 +258,54 @@
 				}
 			}
 
-			// Adjust when switching editor modes.
-			function mceShow() {
-				$window.on( 'scroll.mce-float-panels', hideFloatPanels );
+			function mceBeforeShow() {
+				var height = $textEditor.height(),
+					scrollTop = $window.scrollTop(),
+					scrollEditorTop = scrollTop - $textEditor.offset().top +
+						heights.adminBarHeight + heights.toolsHeight + heights.textTopHeight,
+					percentageScrolled = scrollEditorTop / height;
+
+				editor.once( 'show', function() {
+					setTimeout( function() {
+						editor.execCommand( 'wpAutoResize' );
+						adjust();
 
-				setTimeout( function() {
-					editor.execCommand( 'wpAutoResize' );
-					adjust();
-				}, 300 );
+						if ( percentageScrolled > 0 ) {
+							height = $visualEditor.height(),
+							scrollEditorTop = Math.round( height * percentageScrolled );
+							scrollTop = scrollEditorTop + $visualEditor.offset().top -
+								( heights.adminBarHeight + heights.toolsHeight );
+
+							$window.scrollTop( scrollTop );
+						}
+					}, 300 );
+				} );
 			}
 
-			function mceHide() {
-				$window.off( 'scroll.mce-float-panels' );
+			function mceBeforeHide() {
+				var height = $visualEditor.height(),
+					scrollTop = $window.scrollTop(),
+					scrollEditorTop = scrollTop - $visualEditor.offset().top +
+						heights.adminBarHeight + heights.toolsHeight,
+					percentageScrolled = scrollEditorTop / height;
 
-				setTimeout( function() {
-					var top = $contentWrap.offset().top;
+				editor.once( 'hide', function() {
+					setTimeout( function() {
+						textEditorResize();
+						adjust();
 
-					if ( window.pageYOffset > top ) {
-						window.scrollTo( window.pageXOffset, top - heights.adminBarHeight );
-					}
+						if ( percentageScrolled > 0 ) {
+							height = $textEditor.height(),
+							scrollEditorTop = Math.round( height * percentageScrolled );
+							scrollTop = scrollEditorTop + $textEditor.offset().top -
+								( heights.adminBarHeight + heights.toolsHeight + heights.textTopHeight );
 
-					textEditorResize();
-					adjust();
-				}, 100 );
+							$window.scrollTop( scrollTop );
+						}
+					}, 100 );
 
-				adjust();
+					adjust();
+				} );
 			}
 
 			function toggleAdvanced() {
@@ -281,8 +314,8 @@
 
 			mceBind = function() {
 				editor.on( 'keyup', mceKeyup );
-				editor.on( 'show', mceShow );
-				editor.on( 'hide', mceHide );
+				editor.on( 'beforeShow', mceBeforeShow );
+				editor.on( 'beforeHide', mceBeforeHide );
 				editor.on( 'wp-toolbar-toggle', toggleAdvanced );
 				// Adjust when the editor resizes.
 				editor.on( 'setcontent wp-autoresize wp-toolbar-toggle', adjust );
@@ -296,8 +329,8 @@
 
 			mceUnbind = function() {
 				editor.off( 'keyup', mceKeyup );
-				editor.off( 'show', mceShow );
-				editor.off( 'hide', mceHide );
+				editor.off( 'beforeShow', mceBeforeShow );
+				editor.off( 'beforeHide', mceBeforeHide );
 				editor.off( 'wp-toolbar-toggle', toggleAdvanced );
 				editor.off( 'setcontent wp-autoresize wp-toolbar-toggle', adjust );
 				editor.off( 'undo redo', mceScroll );
