0

代码有效,但仅在第一次有效

if (dialogName == 'image') {
    dialogDefinition.removeContents('upload');
    dialogDefinition.removeContents('advanced');
    dialogDefinition.removeContents('Link');

    var infoTab = dialogDefinition.getContents('info');
    infoTab.remove('txtAlt');
    infoTab.remove('txtBorder');
    infoTab.remove('txtHSpace');
    infoTab.remove('txtVSpace');
    infoTab.remove('cmbAlign');

    dialogDefinition.onLoad = function () {
        this.selectPage('Upload');
    };
}

如果我不刷新页面,点击“图片”按钮两次不是“上传”。需要一些帮助,tks

4

1 回答 1

0

您可以将此代码放在 config.js 中:

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 == 'link') {
        dialogDefinition.removeContents('advanced'); //remove advanced tab

        var infoTab = dialogDefinition.getContents('info');
        var urlField = infoTab.get('url');
        urlField['default'] = 'www.ireadhome.com'; //set default value for the url field
    }
});
于 2013-08-24T06:12:09.280 回答