From 3b585cd9ca0b86506aa5d7bf5eb7d41e1f67ed22 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Wed, 11 Mar 2015 20:07:54 +0000 Subject: [PATCH] TinyMCE, floating toolbars: return early if no selected element in the editor. See #30619. git-svn-id: https://develop.svn.wordpress.org/trunk@31727 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/js/tinymce/plugins/wordpress/plugin.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js b/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js index 9aa5462b2c..fd2cf2646f 100644 --- a/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js +++ b/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js @@ -585,6 +585,10 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) { margin = 8, adminbarHeight = 0; + if ( ! currentSelection ) { + return; + } + windowPos = window.pageYOffset || document.documentElement.scrollTop; adminbar = tinymce.$( '#wpadminbar' )[0]; mceToolbar = tinymce.$( '.mce-toolbar-grp', editor.getContainer() )[0];