javascript - ckeditor v4.6 - save custom attribute in link plugin -
i have added following code link.js add custom select menu new attribute. code precedes code adding browse button.
{ type: 'select', id: 'customtype', label: 'custom link type', 'default': 'type1', items: [ [ 'unassigned', 'unassigned' ], [ 'type 1', 'type1' ], [ 'type 2', 'type2' ], [ 'type 3', 'type3' ] ], setup: function( data ) { if ( data.customtype ) this.setvalue( data.customtype ); }, commit: function( data ) { data.customtype = this.getvalue(); } },
the select menu in link dialog, , default works properly.
i have tried code in onok function:
if (data.customtype) attributes["custom-attr"] = data.customtype; else attributes["custom-attr"] = "";
the custom attribute never saved in anchor tag. js error saying "cannot set property 'custom-attr' of undefined". need point in right direction resolve this.
i have code working in link plugin v4.3.3, having 0 success in v4.6.
Comments
Post a Comment