TinyMCE: make sure the editor is not completely empty before checking if the user clicked above or below a wpView.

Fixes #31765.
Built from https://develop.svn.wordpress.org/trunk@31888


git-svn-id: http://core.svn.wordpress.org/trunk@31867 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2015-03-25 18:55:29 +00:00
parent 4fbba16960
commit 1b2d93fbca
4 changed files with 10 additions and 5 deletions

View File

@ -219,10 +219,15 @@ tinymce.PluginManager.add( 'wpview', function( editor ) {
body = editor.getBody(),
bodyRect = body.getBoundingClientRect(),
first = body.firstChild,
firstRect = first.getBoundingClientRect(),
last = body.lastChild,
lastRect = last.getBoundingClientRect(),
view;
firstRect, lastRect, view;
if ( ! first || ! last ) {
return;
}
firstRect = first.getBoundingClientRect();
lastRect = last.getBoundingClientRect();
if ( y < firstRect.top && ( view = getView( first ) ) ) {
setViewCursor( true, view );

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.2-beta2-31887';
$wp_version = '4.2-beta2-31888';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.