- this.move( this._.moved ? this._.position.x : ( viewSize.width - dialogSize.width ) / 2,\r
- this._.moved ? this._.position.y : ( viewSize.height - dialogSize.height ) / 2 );\r
+ var posX = ( viewSize.width - dialogSize.width ) / 2,\r
+ posY = ( viewSize.height - dialogSize.height ) / 2;\r
+\r
+ // Switch to absolute position when viewport is smaller than dialog size.\r
+ if ( !CKEDITOR.env.ie6Compat )\r
+ {\r
+ if ( dialogSize.height + ( posY > 0 ? posY : 0 ) > viewSize.height ||\r
+ dialogSize.width + ( posX > 0 ? posX : 0 ) > viewSize.width )\r
+ el.setStyle( 'position', 'absolute' );\r
+ else\r
+ el.setStyle( 'position', 'fixed' );\r
+ }\r
+\r
+ this.move( this._.moved ? this._.position.x : posX,\r
+ this._.moved ? this._.position.y : posY );\r