【问题标题】:CKEditor - Image Properties dialog is blankCKEditor - 图像属性对话框为空白
【发布时间】:2015-09-30 04:34:10
【问题描述】:

我正在使用具有通常值的默认图像插件:

  CKEDITOR.replace( 'editor', 

                      {
                        filebrowserBrowseUrl: '/app/myimages.html',
                        filebrowserUploadUrl: '/app/myfiles.html',
                        filebrowserImageBrowseUrl: '/app/myimages.html'
}

通过图像选择对话框选择后,图像在编辑器中正确显示。

但是当我右键单击图像并选择图像属性菜单时。
打开的对话框不包含图像 URL 或宽度或高度等。它基本上没有值。

【问题讨论】:

    标签: javascript jquery ckeditor


    【解决方案1】:

    见我的 cmets。但对我来说,它覆盖了 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';
    			}
    		});

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-23
    • 2021-02-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多