TinyMCE: ensure the image toolbar stays visible when the image is much wider than the editor.

Props iseulde.
Merges [31362] to the 4.1 branch.
Fixes #30696.

Built from https://develop.svn.wordpress.org/branches/4.1@31437


git-svn-id: http://core.svn.wordpress.org/branches/4.1@31418 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dion Hulse 2015-02-12 06:02:24 +00:00
parent 1c36669bce
commit 8518481173
3 changed files with 4 additions and 2 deletions

View File

@ -238,7 +238,9 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
left = boundaryMiddle - toolbarHalf;
left += iframePos.x;
if ( toolbarWidth >= windowWidth ) {
if ( boundary.left < 0 || boundary.right > iframeWidth ) {
left = iframePos.x + ( iframeWidth - toolbarWidth ) / 2;
} else if ( toolbarWidth >= windowWidth ) {
className += ' mce-arrow-full';
left = 0;
} else if ( ( left < 0 && boundary.left + toolbarWidth > windowWidth ) ||

File diff suppressed because one or more lines are too long