From 329115bf05b8a55156191a276cb13d3f9cea9928 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Fri, 6 Feb 2015 22:24:43 +0000 Subject: [PATCH] Editor: prevent errors in editor-expand when the Text editor is not used. Props iseulde, fixes #31163. git-svn-id: https://develop.svn.wordpress.org/trunk@31361 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/editor-expand.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/js/editor-expand.js b/src/wp-admin/js/editor-expand.js index 71dd130ad3..fac78239ac 100644 --- a/src/wp-admin/js/editor-expand.js +++ b/src/wp-admin/js/editor-expand.js @@ -323,7 +323,7 @@ var windowPos = $window.scrollTop(), type = event && event.type, resize = type !== 'scroll', - visual = ( mceEditor && ! mceEditor.isHidden() ), + visual = mceEditor && ! mceEditor.isHidden(), buffer = autoresizeMinHeight, postBodyTop = $postBody.offset().top, borderWidth = 1, @@ -350,6 +350,11 @@ topHeight = heights.textTopHeight; } + // TinyMCE still intializing. + if ( ! visual && ! $top.length ) { + return; + } + topPos = $top.parent().offset().top; editorPos = $editor.offset().top; editorHeight = $editor.outerHeight();