![](/img/trans.png)
[英]CKEDITOR: Prevent image properties dialog from appearing on <img> double click
[英]CKEditor - Image Properties dialog is blank
我正在使用具有常规值的默认Image插件:
CKEDITOR.replace( 'editor',
{
filebrowserBrowseUrl: '/app/myimages.html',
filebrowserUploadUrl: '/app/myfiles.html',
filebrowserImageBrowseUrl: '/app/myimages.html'
}
通过图像选择对话框选择后,图像会在编辑器中正确显示。
但是,当我右键单击图像并选择“图像属性”菜单时。
打开的对话框不包含图像URL或宽度或高度等。它实际上没有值。
查看我的评论。 但是对我来说,它覆盖了onShow()。
CKEDITOR.on('dialogDefinition', function( ev ) { // Take the dialog window name and its definition from the event data. var dialogName = ev.data.name; var dialogDefinition = ev.data.definition; if ( dialogName == 'image' ) { /*dialogDefinition.onShow = function() { this.selectPage( 'info' ); };*/ // do not override this function, it will cause a JS on save (setCustomData can not be found on null object), and the edit image will not fill in its fields. dialogDefinition.removeContents( 'Link' ); // remove these tabs dialogDefinition.removeContents( 'advanced' ); dialogDefinition.removeContents( 'Upload' ); var contents = dialogDefinition.getContents( 'info' ); //contents.remove( 'htmlPreview' ); // will cause a JS error if disabled. contents.remove( 'ratioLock' ); contents.remove( 'txtHSpace' ); contents.remove( 'txtVSpace' ); contents.remove( 'txtAlt' ); contents.remove( 'txtBorder' ); contents.get('txtWidth').width = 'auto'; contents.get('txtHeight').width = 'auto'; contents.get('txtUrl').disabled = 'disabled'; } });
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.