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

Fixes #31765.

git-svn-id: https://develop.svn.wordpress.org/trunk@31888 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2015-03-25 18:54:22 +00:00
parent 135be2826d
commit e12762a76c
1 changed files with 8 additions and 3 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 );