禁用图像属性中的宽度和高度字段 windows

Disable width and height fields from image properties windows

禁用图像属性的宽度和高度字段我正在使用 ckeditor 4

CKEDITOR.replace('<%=txtCkEditor.ClientID %>', {allowedContent:'img[!src,alt];'});

通过使用上述方法,它仅显示隐藏了宽度和高度的图像属性,其余控件也变得可见 false。请向我建议一个从图像属性 windows 禁用宽度和高度字段的解决方案。 提前致谢。

我不确定我是否完全理解你的问题。您似乎想隐藏允许输入高度和宽度的字段。您的初始解决方案似乎不会影响对话框,但会保存哪些内容。这些是非常不同的解决方案。我的回答假设您正在寻求更改图像属性对话框字段。

的基础上,我推荐添加如下配置:

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

    if (dialogName == 'image') {
        var infoTab = dialogDefinition.getContents( 'info' );
        infoTab.remove( 'txtWidth' ); // Remove width element from Info tab
        infoTab.remove( 'txtHeight' ); // Remove height element from Info tab
    }
});