Search code examples
windowsuser-interfacedialogckeditor

ckeditor dialog positioning


Dialog windows for CKEditor by default appear in the middle of the page but if the page is an iframe with a big height the dialogs appear way down the page.

Is it possible to configure CKEditor to position the dialogs in a different quadrant of the page? For example top middle?


Solution

  • Yes, the link MDaubs gives will guide you to do what you want.

    I've had to do this in the past and the following snippet will demonstrate a solution for your problem:

    CKEDITOR.on('dialogDefinition', function(e) {
        var dialogName = e.data.name;
        var dialogDefinition = e.data.definition;
        dialogDefinition.onShow = function() {
                this.move(this.getPosition().x,0); // Top center
        }
    })
    

    You can place this in the config file or the ready function for jQuery.