Make WordPress Core

Changeset 31888


Ignore:
Timestamp:
03/25/2015 06:54:22 PM (12 years ago)
Author:
azaozz
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/tinymce/plugins/wpview/plugin.js

    r31856 r31888  
    220220                        bodyRect = body.getBoundingClientRect(),
    221221                        first = body.firstChild,
    222                         firstRect = first.getBoundingClientRect(),
    223222                        last = body.lastChild,
    224                         lastRect = last.getBoundingClientRect(),
    225                         view;
     223                        firstRect, lastRect, view;
     224
     225                if ( ! first || ! last ) {
     226                        return;
     227                }
     228
     229                firstRect = first.getBoundingClientRect();
     230                lastRect = last.getBoundingClientRect();
    226231
    227232                if ( y < firstRect.top && ( view = getView( first ) ) ) {
Note: See TracChangeset for help on using the changeset viewer.