Select Git revision
-
David Wilson authoredDavid Wilson authored
editor-expand.js 41.84 KiB
( function( window, $, undefined ) {
'use strict';
var $window = $( window ),
$document = $( document ),
$adminBar = $( '#wpadminbar' ),
$footer = $( '#wpfooter' );
/**
* @summary Handles the resizing of the editor.
*
* @since 4.0.0
*
* @returns {void}
*/
$( function() {
var $wrap = $( '#postdivrich' ),
$contentWrap = $( '#wp-content-wrap' ),
$tools = $( '#wp-content-editor-tools' ),
$visualTop = $(),
$visualEditor = $(),
$textTop = $( '#ed_toolbar' ),
$textEditor = $( '#content' ),
textEditor = $textEditor[0],
oldTextLength = 0,
$bottom = $( '#post-status-info' ),
$menuBar = $(),
$statusBar = $(),
$sideSortables = $( '#side-sortables' ),
$postboxContainer = $( '#postbox-container-1' ),
$postBody = $('#post-body'),
fullscreen = window.wp.editor && window.wp.editor.fullscreen,
mceEditor,
mceBind = function(){},
mceUnbind = function(){},
fixedTop = false,
fixedBottom = false,
fixedSideTop = false,
fixedSideBottom = false,
scrollTimer,
lastScrollPosition = 0,
pageYOffsetAtTop = 130,
pinnedToolsTop = 56,
sidebarBottom = 20,
autoresizeMinHeight = 300,
initialMode = $contentWrap.hasClass( 'tmce-active' ) ? 'tinymce' : 'html',
advanced = !! parseInt( window.getUserSetting( 'hidetb' ), 10 ),
// These are corrected when adjust() runs, except on scrolling if already set.
heights = {
windowHeight: 0,
windowWidth: 0,
adminBarHeight: 0,
toolsHeight: 0,
menuBarHeight: 0,
visualTopHeight: 0,
textTopHeight: 0,
bottomHeight: 0,
statusBarHeight: 0,
sideSortablesHeight: 0
};
/**
* @summary Resizes textarea based on scroll height and width.
*
* Resizes textarea based on scroll height and width. Doesn't shrink the
* editor size below the 300px auto resize minimum height.
*
* @since 4.6.1
*
* @returns {void}