Ticket #939 (closed New Feature: duplicate)

Opened 7 years ago

Last modified 2 years ago

add toolbar buttons at runtime

Reported by: saul11 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

comment:1 Changed 7 years ago by alfonsoml

  • Keywords dynamic add toolbar button runtime removed

comment:2 Changed 7 years ago by alfonsoml

  • Type changed from Bug to New Feature

comment:3 Changed 6 years ago by arczi

  • Status changed from new to closed
  • Resolution set to duplicate

DUP of #938

comment:4 Changed 6 years ago by arczi

  • Keywords Confirmed added
  • Status changed from closed to reopened
  • Resolution duplicate deleted

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 2 years ago by j.swiderski

  • Keywords Confirmed removed
  • Status changed from reopened to closed
  • Resolution set to duplicate

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 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy