Programmatically set the position of CKEditor's dialogs

谁说我不能喝 提交于 2019-12-01 21:17:07

After spending several hours today, I was able to figure this out by complete luck. Dialog definitions can be manipulated at load time. Within your config.js file, add the following:

CKEDITOR.on('dialogDefinition', function(e) {
    var dialogName = e.data.name;
    var dialogDefinition = e.data.definition;

    dialogDefinition.onShow = function() {
        // Calculate your newX and newY ...
        this.move(newX, newY);
    }
}

If you want to adjust the position for a specific dialog you can use dialogName to test for it.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!