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:
parent
4fbba16960
commit
1b2d93fbca
|
@ -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 );
|
||||||
|
|
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue