ckeditor dialog positioning

前端 未结 5 1493
臣服心动
臣服心动 2021-01-17 16:40

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 po

5条回答
  •  被撕碎了的回忆
    2021-01-17 17:16

    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.

提交回复
热议问题