X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/4feeb71a9d812a9ae371c28a3d8b442a4394ded7..607b7e02d77e7326161e8ec15639052d2040f745:/wp-includes/js/tinymce/themes/modern/theme.js diff --git a/wp-includes/js/tinymce/themes/modern/theme.js b/wp-includes/js/tinymce/themes/modern/theme.js index ab20a8a3..0e079f63 100644 --- a/wp-includes/js/tinymce/themes/modern/theme.js +++ b/wp-includes/js/tinymce/themes/modern/theme.js @@ -439,7 +439,7 @@ tinymce.ThemeManager.add('modern', function(editor) { } function reposition(match) { - var relPos, panelRect, elementRect, contentAreaRect, panel, relRect, testPositions; + var relPos, panelRect, elementRect, contentAreaRect, panel, relRect, testPositions, smallElementWidthThreshold; if (editor.removed) { return; @@ -462,6 +462,7 @@ tinymce.ThemeManager.add('modern', function(editor) { elementRect = getElementRect(match.element); panelRect = tinymce.DOM.getRect(panel.getEl()); contentAreaRect = tinymce.DOM.getRect(editor.getContentAreaContainer() || editor.getBody()); + smallElementWidthThreshold = 25; // We need to use these instead of the rect values since the style // size properites might not be the same as the real size for a table @@ -473,7 +474,7 @@ tinymce.ThemeManager.add('modern', function(editor) { } // Inflate the elementRect so it doesn't get placed above resize handles - if (editor.selection.controlSelection.isResizable(match.element)) { + if (editor.selection.controlSelection.isResizable(match.element) && elementRect.w < smallElementWidthThreshold) { elementRect = Rect.inflate(elementRect, 0, 8); } @@ -485,7 +486,7 @@ tinymce.ThemeManager.add('modern', function(editor) { movePanelTo(panel, userConstrain(relRect.x, relRect.y, elementRect, contentAreaRect, panelRect)); } else { // Allow overflow below the editor to avoid placing toolbars ontop of tables - contentAreaRect.h += 40; + contentAreaRect.h += panelRect.h; elementRect = Rect.intersect(contentAreaRect, elementRect); if (elementRect) { @@ -505,7 +506,7 @@ tinymce.ThemeManager.add('modern', function(editor) { } togglePositionClass(panel, relPos, function(pos1, pos2) { - return (!elementRect || elementRect.w > 40) && pos1 === pos2; + return pos1 === pos2; }); //drawRect(contentAreaRect, 'blue'); @@ -847,7 +848,7 @@ tinymce.ThemeManager.add('modern', function(editor) { // Add statusbar if needed if (settings.statusbar !== false) { panel.add({type: 'panel', name: 'statusbar', classes: 'statusbar', layout: 'flow', border: '1 0 0 0', ariaRoot: true, items: [ - {type: 'elementpath'}, + {type: 'elementpath', editor: editor}, resizeHandleCtrl ]}); }