所以我在表格信息对话框中删除了一堆按钮。只剩下5个按钮,所以默认大小感觉很空。
以下是代码:
CKEDITOR.on( 'dialogDefinition', function( ev ) {
var dialogName = ev.data.name;
var dialogDefinition = ev.data.definition;
if(dialogName == 'table' || dialogName == 'tableProperties'){
var advTab = dialogDefinition.getContents('advanced');
var infoTab = dialogDefinition.getContents('info');
var advClass = advTab.get('advCSSClasses');
var cmbAlignBut = infoTab.get('cmbAlign');
infoTab.remove('txtSummary');
infoTab.remove('txtCaption');
infoTab.remove('selBorder');
infoTab.remove('txtCellSpace');
infoTab.remove('txtCellPad');
infoTab.remove('selHeaders');
infoTab.remove('cmbAlign');
infoTab.remove('txtBorder');
advClass.type = "select";
advClass.requiredContent = "table(cke-xyz)";
advClass.label = "Table Type";
advClass.default = "normal-table";
advClass.items = [
["Normal", "normal-table"],
["Comparison", "comparison-table"],
["Links", "link-table"]
];
infoTab.add(advClass);
dialogDefinition.removeContents('advanced');
console.log(advClass);
console.log(cmbAlignBut);
}
});
以下是它的样子:
如何调整至少高度?
答案 0 :(得分:1)
请参阅:https://github.com/ckeditor/ckeditor-dev/blob/master/plugins/table/dialogs/table.js#L60
对话通常分配minHeight
。如果您想更改它,请使用:
CKEDITOR.on( 'dialogDefinition', function( ev ) {
var dialogName = ev.data.name;
var dialogDefinition = ev.data.definition;
if(dialogName == 'table' || dialogName == 'tableProperties'){
ev.data.definition.minHeight = 120; // you can also use ev.data.definition.minHeight = 0;
...