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:
parent
135be2826d
commit
e12762a76c
|
@ -219,10 +219,15 @@ tinymce.PluginManager.add( 'wpview', function( editor ) {
|
||||||
body = editor.getBody(),
|
body = editor.getBody(),
|
||||||
bodyRect = body.getBoundingClientRect(),
|
bodyRect = body.getBoundingClientRect(),
|
||||||
first = body.firstChild,
|
first = body.firstChild,
|
||||||
firstRect = first.getBoundingClientRect(),
|
|
||||||
last = body.lastChild,
|
last = body.lastChild,
|
||||||
lastRect = last.getBoundingClientRect(),
|
firstRect, lastRect, view;
|
||||||
view;
|
|
||||||
|
if ( ! first || ! last ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
firstRect = first.getBoundingClientRect();
|
||||||
|
lastRect = last.getBoundingClientRect();
|
||||||
|
|
||||||
if ( y < firstRect.top && ( view = getView( first ) ) ) {
|
if ( y < firstRect.top && ( view = getView( first ) ) ) {
|
||||||
setViewCursor( true, view );
|
setViewCursor( true, view );
|
||||||
|
|
Loading…
Reference in New Issue