CKEditor: remove link type parameter, but set URL as default link type?

I am using the Link plugin for CKEditor, and I am trying to remove the Link Type parameter so that the user can enter the address in the URL field and not set the Link Type parameter. When I use the code below, it removes the Link Type parameter, but when I try to click the link that it creates, it does not open the link as intended.

So, I am wondering how can I set the โ€œLink Typeโ€ by default as a URL so that the link can be opened successfully, but also remove the โ€œLink Typeโ€ parameter manually?

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

    if (dialogName == 'link') {
        var infoTab = dialogDefinition.getContents('info');
        infoTab.remove('linkType'); 
    }
});

enter image description here

+2
source share
1 answer

, , infoTab.remove('linkType');, . , , , .style = :

if ( dialogName == 'link' ) {
    var infoTab = dialogDefinition.getContents( 'info' );
    infoTab.get( 'linkType' ).style = 'display: none';
}

----- โ†’ >

, -! , .

+2

All Articles