我们如何使ckeditor对话框不可调整大小,不可拖动

how we make ckeditor dialog non resizable ,non draggable?

本文关键字:拖动 可调整 何使 ckeditor 对话框 我们      更新时间:2023-09-26

我正在为CKEditor创建一个名为small image repository system的新插件。我做得很成功。但我遇到了一个问题,当我自动加载一组图像时,对话框高度会自动增加。所以请建议我如何使CKEditor不可拖动和不可调整大小?

我已经尝试过为CKEditor制作不调整大小对话框的代码,如下所示:

resizable : CKEDITOR.DIALOG_RESIZE_NONE

但我仍然没有解决我的问题,请帮助我

CKEDITOR.dialog.add('plugin_name', function (editor){
                var id = editor.id;
                return {
                    minWidth: 820,
                    minHeight: 400,
                    resizable : CKEDITOR.DIALOG_RESIZE_NONE,////resize disble
                    contents:
                    [
                        {
                            id: 'iframe',
                            expand: true,
                            elements:
                                [
                                   {
                                       type: 'html',
                                       html: '<div style="width:820px;height:400px"><iframe src="' + CKEDITOR.plugins.getPath('foot_notes') + 'dialogs/test.html" frameborder="0" name="iframeinsert' + id + '" id="iframeinsert' + id + '" allowtransparency="1" style="width:820px;height:400px;margin:0;padding:0; resize: none;" scrolling="no"></iframe></div>'
                                   }
                                ]
                        }
                    ],
                };
            });

将对话框的resizable属性设置为CKEDITOR.DIALOG_RESIZE_NONE只会阻止用户更改对话框窗口的大小。顺便说一句,CKEDITOR.DIALOG_RESIZE_NONE是默认值,因此不需要在对话框定义中显式设置它。你可以在这里找到CKEditor关于这个主题的文档页面。

听起来您需要做的是设置height属性。这会将对话框的高度设置为您指定给它的值(以像素为单位)。

干杯!