简体   繁体   English

如何将滚动条添加到上下文菜单ckeditor

[英]How to add scroll bar to context menu ckeditor

I am adding items in context menu. 我在上下文菜单中添加项目。 When too many items get added it comes on ckeditor. 当添加太多项目时,它会出现在ckeditor上。 So i want to have scroll bar for context menu. 所以我想要上下文菜单的滚动条。

editor.addMenuItem(suggestionBoxItem,
                                        {
                                            id: Id,
                                            label: menuLabel,
                                            group: 'suggestionBoxGroup',
                                            icon: null,
                                            onClick: function () {
                                                editor.setData('');
                                                editor.insertHtml(this.labelText);
                                            },
                                        });

You have to customize ckeditor CSS. 你必须自定义ckeditor CSS。 In your ckeditor/skins/SKIN_NAME folder you have to find following properties in corresponding *.css file (in my case it was editor.css and override them. 在ckeditor / skins / SKIN_NAME文件夹中,您必须在相应的* .css文件中找到以下属性(在我的情况下,它是editor.css并覆盖它们。

.cke_panel {
    height: YOUR_DEFAULT_HEIGHT;
    max-height: MAX_HEIGHT;
}

.cke_menu_panel {
    overflow-y: auto;
}

Where height is your default height when context menu is loading and no overflow is present. 如果加载上下文菜单时高度是您的默认高度,并且不存在溢出。 And max height is when scrolling in context menu is enabled. 最大高度是在启用上下文菜单时滚动。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM