Opened 5 years ago

Last modified 5 years ago

#12287 confirmed Bug

Unable to create link when certain fields are removed from the dialog

Reported by: getshao Owned by:
Priority: Normal Milestone:
Component: UI : Dialogs Version:
Keywords: Cc:

Description

Unable to create link when certain fields are removed from the dialog. In other words, some default values are missing.

Before I was usign the following code to remove the linktype and protocol fields in the link dialog I don't need...

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

This will still remove the items, but when trying to hit enter or ok the dialog just fails.

From here:http://ckeditor.com/forums/Plugins/Problems-removing-dialog-fields-of-link-plugin-in-4.4.3

Attachments (2)

Screen Shot 2014-08-08 at 1.14.37 PM.png (31.4 KB) - added by getshao 5 years ago.
Screen Shot 2014-08-08 at 1.15.19 PM.png (31.1 KB) - added by getshao 5 years ago.

Download all attachments as: .zip

Change History (3)

Changed 5 years ago by getshao

Changed 5 years ago by getshao

comment:1 Changed 5 years ago by Piotrek Koszuliński

Status: newconfirmed
Version: 4.4.3

Removing inputs will cause losing default values and this is correct. However, link dialog could work without protocol and link type inputs, because many users don't need them, so it would be useful if plugin didn't expect them.

To work around this you can hide the type input and remove the protocol input from the 'hbox' element:

if ( dialogName == 'link' ) {
	var infoTab = dialogDefinition.getContents( 'info' );
	infoTab.get( 'linkType' ).style = 'display: none';
	infoTab.get( 'urlOptions' ).children[ 0 ].children.shift();
}

I'm not sure why removing element from hbox works - perhaps the element is already registered and we change only the UI.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy