Ticket #30668: 30668.2.patch
| File 30668.2.patch, 2.5 KB (added by , 11 years ago) |
|---|
-
src/wp-admin/js/editor-expand.js
803 803 mouseY = event.pageY; 804 804 } ); 805 805 806 function recalcEditorRect() { 807 editorRect = $editor.offset(); 808 editorRect.right = editorRect.left + $editor.outerWidth(); 809 editorRect.bottom = editorRect.top + $editor.outerHeight(); 810 } 811 806 812 function activate() { 807 813 if ( ! _isActive ) { 808 814 _isActive = true; … … 909 915 $overlay 910 916 // Always recalculate the editor area entering the overlay with the mouse. 911 917 .on( 'mouseenter.focus', function() { 912 editorRect = $editor.offset(); 913 editorRect.right = editorRect.left + $editor.outerWidth(); 914 editorRect.bottom = editorRect.top + $editor.outerHeight(); 918 recalcEditorRect(); 915 919 916 920 $window.on( 'scroll.focus', function() { 917 921 var nScrollY = window.pageYOffset; … … 937 941 } ) 938 942 // Fade in when the mouse moves away form the editor area. 939 943 .on( 'mousemove.focus', function( event ) { 940 var nx = event.pageX, 941 ny = event.pageY; 944 var nx = event.clientX, 945 ny = event.clientY, 946 pageYOffset = window.pageYOffset; 942 947 943 948 if ( x && y && ( nx !== x || ny !== y ) ) { 944 949 if ( 945 ( ny <= y && ny < editorRect.top ) ||946 ( ny >= y && ny > editorRect.bottom ) ||950 ( ny <= y && ny < editorRect.top + pageYOffset ) || 951 ( ny >= y && ny > editorRect.bottom + pageYOffset ) || 947 952 ( nx <= x && nx < editorRect.left ) || 948 953 ( nx >= x && nx > editorRect.right ) 949 954 ) { … … 951 956 traveledY += Math.abs( y - ny ); 952 957 953 958 if ( ( 954 ny <= editorRect.top - buffer ||955 ny >= editorRect.bottom + buffer ||959 ny <= editorRect.top - buffer + pageYOffset || 960 ny >= editorRect.bottom + buffer + pageYOffset || 956 961 nx <= editorRect.left - buffer || 957 962 nx >= editorRect.right + buffer 958 963 ) && ( … … 1151 1156 editor.on( 'blur', maybeFadeIn ); 1152 1157 editor.on( 'focus', focus ); 1153 1158 editor.on( 'blur', blur ); 1159 editor.on( 'wp-autoresize', recalcEditorRect ); 1154 1160 }; 1155 1161 1156 1162 mceUnbind = function() { … … 1158 1164 editor.off( 'blur', maybeFadeIn ); 1159 1165 editor.off( 'focus', focus ); 1160 1166 editor.off( 'blur', blur ); 1167 editor.off( 'wp-autoresize', recalcEditorRect ); 1161 1168 }; 1162 1169 1163 1170 if ( _isOn ) {