Make WordPress Core

Changeset 44697


Ignore:
Timestamp:
01/24/2019 11:23:28 AM (6 years ago)
Author:
azaozz
Message:

TinyMCE Classic Block: fix repositioning of the inline toolbar on scrolling.

Props iseulde, azaozz.
Fixes #46062.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/vendor/tinymce/plugins/wordpress/plugin.js

    r44257 r44697  
    10651065        }
    10661066
    1067         // For full height editor.
    1068         editor.on( 'resizewindow scrollwindow', hide );
    1069         // For scrollable editor.
    1070         editor.dom.bind( editor.getWin(), 'resize scroll', hide );
     1067        editor.dom.bind( editor.getWin(), 'resize', hide );
     1068
     1069        if ( editor.inline ) {
     1070            // Enable `capture` for the event.
     1071            // This will hide/reposition the toolbar on any scrolling in the document.
     1072            document.addEventListener( 'scroll', hide, true );
     1073        } else {
     1074            editor.dom.bind( editor.getWin(), 'scroll', hide );
     1075            // For full height iframe editor.
     1076            editor.on( 'resizewindow scrollwindow', hide );
     1077        }
    10711078
    10721079        editor.on( 'remove', function() {
     1080            document.removeEventListener( 'scroll', hide, true );
    10731081            editor.off( 'resizewindow scrollwindow', hide );
    10741082            editor.dom.unbind( editor.getWin(), 'resize scroll', hide );
Note: See TracChangeset for help on using the changeset viewer.