var $window = $( window ),
$document = $( document ),
$adminBar = $( '#wpadminbar' ),
var $window = $( window ),
$document = $( document ),
$adminBar = $( '#wpadminbar' ),
// We need to wait for TinyMCE to initialize.
$document.on( 'tinymce-editor-init.editor-expand', function( event, editor ) {
// We need to wait for TinyMCE to initialize.
$document.on( 'tinymce-editor-init.editor-expand', function( event, editor ) {
editor.on( 'hide', mceHide );
// Adjust when the editor resizes.
editor.on( 'setcontent wp-autoresize wp-toolbar-toggle', adjust );
editor.on( 'hide', mceHide );
// Adjust when the editor resizes.
editor.on( 'setcontent wp-autoresize wp-toolbar-toggle', adjust );
editor.off( 'show', mceShow );
editor.off( 'hide', mceHide );
editor.off( 'setcontent wp-autoresize wp-toolbar-toggle', adjust );
editor.off( 'show', mceShow );
editor.off( 'hide', mceHide );
editor.off( 'setcontent wp-autoresize wp-toolbar-toggle', adjust );