]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/tinymce/themes/modern/theme.js
Wordpress 4.6
[autoinstalls/wordpress.git] / wp-includes / js / tinymce / themes / modern / theme.js
index ab20a8a36c9a42785be331039cbe2e329a1ef9ff..0e079f63793792302e6d64cb6bf676c46378dfbc 100644 (file)
@@ -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
                        ]});
                }