});
};
+ function parentDialog(e) {
+ return e.getParents().filter( function(parent) {
+ return parent.$.classList.contains("ui-dialog-content")
+ })[0];
+ };
+
function attach( editor ) {
var config = editor.config,
- parent = parentScroll(editor.element);
+ parent = parentScroll(editor.element),
+ divelt = editor.element.getNext(function(elt){return elt.getAttribute("class") === "cke_textarea_inline"}),
+ inline = editor.element.$.classList.contains("texteditor-in-dialog");
+
+ var dialog;
+
+ if (inline) {
+ dialog = parentDialog(divelt);
+ }
var resize = function (width, height) {
var editable;
var viewRect = win.getViewPaneSize();
float_space.setStyle( 'position', 'absolute' );
- float_space.setStyle( 'top', pixelate( editorPos.y + editorRect.height - floatRect.height + 1) );
- float_space.setStyle( 'right', pixelate( viewRect.width - editorRect.right ) );
+ if (inline) {
+ var dialogPos = dialog.getDocumentPosition();
+ float_space.setStyle( 'top', pixelate( editorPos.y - dialogPos.y + editorRect.height - floatRect.height + 1 ) );
+
+ //float_space.setStyle( 'left', pixelate( editorPos.x - dialogPos.x + editorRect.width - floatRect.width ) );
+ // floatRect.width seems to be far to high on first dialog popup
+ float_space.setStyle( 'left', pixelate( editorPos.x - dialogPos.x + editorRect.width - 11 ) );
+ } else {
+ float_space.setStyle( 'top', pixelate( editorPos.y + editorRect.height - floatRect.height + 1) );
+ float_space.setStyle( 'right', pixelate( viewRect.width - editorRect.right ) );
+ }
};
var float_html = '<div class="cke_editor_inline_resize_button">\u25E2</div>'; // class so that csss can overrise content and style
- var float_space = CKEDITOR.document.getBody().append( CKEDITOR.dom.element.createFromHtml( float_html ));
+ var float_space = inline ? divelt.getParent().append( CKEDITOR.dom.element.createFromHtml( float_html ))
+ : CKEDITOR.document.getBody().append( CKEDITOR.dom.element.createFromHtml( float_html ));
var drag_handler = function( evt ) {
var width = startSize.width + evt.data.$.screenX - origin.x,
* ltr support
* textarea/div mode safe, currently simply assumes that textarea inline is used
* positioning of resize handle is not browser zomm safe
+ * positioning of resize handle in dialog with scroll bars is broken
*/