}
function reposition(match) {
- var relPos, panelRect, elementRect, contentAreaRect, panel, relRect, testPositions;
+ var relPos, panelRect, elementRect, contentAreaRect, panel, relRect, testPositions, smallElementWidthThreshold;
if (editor.removed) {
return;
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
}
// 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);
}
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) {
}
togglePositionClass(panel, relPos, function(pos1, pos2) {
- return (!elementRect || elementRect.w > 40) && pos1 === pos2;
+ return pos1 === pos2;
});
//drawRect(contentAreaRect, 'blue');
// 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
]});
}