Make WordPress Core

Ticket #30938: 30938.patch

File 30938.patch, 1.4 KB (added by iseulde, 11 years ago)
  • src/wp-includes/js/tinymce/plugins/wpview/plugin.js

     
    162162                        toolbar = editor.$( viewNode ).find( '.toolbar' ),
    163163                        editorToolbar = tinymce.$( editor.editorContainer ).find( '.mce-toolbar-grp' )[0],
    164164                        editorToolbarBottom = ( editorToolbar && editorToolbar.getBoundingClientRect().bottom ) || 0;
    165                
     165
    166166                if ( toolbar.length && editor.iframeElement ) {
    167167                        // 48 = 43 for the toolbar + 5 buffer
    168168                        delta = viewNode.getBoundingClientRect().top + editor.iframeElement.getBoundingClientRect().top - editorToolbarBottom - 48;
     
    264264                } else if ( y > lastRect.bottom && ( view = getView( last ) ) ) {
    265265                        setViewCursor( false, view );
    266266                        event.preventDefault();
    267                 } else {
     267                } else if ( x < bodyRect.left || x > bodyRect.right ) {
    268268                        tinymce.each( editor.dom.select( '.wpview-wrap' ), function( view ) {
    269269                                var rect = view.getBoundingClientRect();
    270270
     271                                if ( y < rect.top ) {
     272                                        return false;
     273                                }
     274
    271275                                if ( y >= rect.top && y <= rect.bottom ) {
    272276                                        if ( x < bodyRect.left ) {
    273277                                                setViewCursor( true, view );
     
    276280                                                setViewCursor( false, view );
    277281                                                event.preventDefault();
    278282                                        }
    279                                         return;
     283
     284                                        return false;
    280285                                }
    281286                        });
    282287                }