Opened 10 years ago

Closed 5 years ago

#939 closed New Feature (duplicate)

add toolbar buttons at runtime

Reported by: Paul Moers Owned by:
Priority: Normal Milestone:
Component: UI : Toolbar Version:
Keywords: Cc:

Description

In the line of thought my request 'create toolbar(set) at runtime' (Ticket #937), it would be great to be able to add existing buttons at runtime.

Change History (5)

comment:1 Changed 10 years ago by Alfonso Martínez de Lizarrondo

Keywords: dynamic add toolbar button runtime removed

comment:2 Changed 10 years ago by Alfonso Martínez de Lizarrondo

Type: BugNew Feature

comment:3 Changed 9 years ago by Artur Formella

Resolution: duplicate
Status: newclosed

DUP of #938

comment:4 Changed 9 years ago by Artur Formella

Keywords: Confirmed added
Resolution: duplicate
Status: closedreopened

I changed my opinion. Right now it is hard to hide button added to ToolbarSets in fckconfig.js

tbButton = new FCKToolbarButton( 'myButton', 'myButton', 'My button', FCK_TOOLBARITEM_ICONTEXT ) ) ;
tbButton.IconPath = icon;
FCKToolbarItems.RegisterItem( 'myButton', tbButton ) ;

if ( !IWantThisButton ) {		//hack to hide myButton 
	tbButton.Create = function()		{return 0;}
	tbButton.Disable  = function()	{return 0;}
	tbButton.RefreshState  = function()	{return 0;} 
}

it should look like...

if ( IWantThisButton ) {
	tbButton = new FCKToolbarButton( 'myButton', 'myButton', 'My button', FCK_TOOLBARITEM_ICONTEXT ) ) ;
}else{
	tbButton = new FCKToolbarButton( 'myButton', 'myButton', 'My button', FCK_TOOLBARITEM_ICONTEXT | FCK_HIDDEN ) ) ;
}

and/or...

tbButton.setState('myButton', FCK_VISIBLE);
tbButton.setState('myButton', FCK_HIDDEN);

comment:5 Changed 5 years ago by Jakub Ś

Keywords: Confirmed removed
Resolution: duplicate
Status: reopenedclosed

FCKeditor is no longer supported and this issue has already been reported for CKEditor.

Closing this one as DUP of #7280

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