From e8c58c47db1421a1d0b2afa9ad4b9eb9e1e338e0 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Wed, 27 Jul 2016 02:58:27 +0000 Subject: [PATCH] TinyMCE: fix the calculation for the inline toolbar vertical position. Fixes #37481. git-svn-id: https://develop.svn.wordpress.org/trunk@38160 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/js/tinymce/plugins/wordpress/plugin.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js b/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js index c3a04fee5f..b930e921f2 100644 --- a/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js +++ b/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js @@ -768,12 +768,11 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) { }, toolbar = this.getEl(), toolbarWidth = toolbar.offsetWidth, - toolbarHeight = toolbar.offsetHeight, + toolbarHeight = toolbar.clientHeight, selection = currentSelection.getBoundingClientRect(), selectionMiddle = ( selection.left + selection.right ) / 2, buffer = 5, - margin = 8, - spaceNeeded = toolbarHeight + margin + buffer, + spaceNeeded = toolbarHeight + buffer, wpAdminbarBottom = wpAdminbar ? wpAdminbar.getBoundingClientRect().bottom : 0, mceToolbarBottom = mceToolbar ? mceToolbar.getBoundingClientRect().bottom : 0, mceStatusbarTop = mceStatusbar ? windowHeight - mceStatusbar.getBoundingClientRect().top : 0, @@ -807,12 +806,12 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) { top = selection.bottom + iframeRect.top + scrollY - iosOffsetBottom; } else if ( spaceTop >= spaceNeeded ) { className = ' mce-arrow-down'; - top = selection.top + iframeRect.top + scrollY - toolbarHeight - margin + iosOffsetTop; + top = selection.top + iframeRect.top + scrollY - toolbarHeight + iosOffsetTop; } } else { if ( spaceTop >= spaceNeeded ) { className = ' mce-arrow-down'; - top = selection.top + iframeRect.top + scrollY - toolbarHeight - margin + iosOffsetTop; + top = selection.top + iframeRect.top + scrollY - toolbarHeight + iosOffsetTop; } else if ( spaceBottom >= spaceNeeded && editorHeight / 2 > selection.bottom + iframeRect.top - blockedTop ) { className = ' mce-arrow-up'; top = selection.bottom + iframeRect.top + scrollY - iosOffsetBottom;