[CKEditor Dev] #13852: There is no way to disable the font and fontsize button on the toolbar

8 views
Skip to first unread message

CKEditor

unread,
Oct 20, 2015, 10:23:29 AM10/20/15
to ckeditor...@googlegroups.com
#13852: There is no way to disable the font and fontsize button on the toolbar
------------------------+---------------------
Reporter: ramendra | Owner:
Type: New Feature | Status: new
Priority: Normal | Component: General
Version: 4.5.4 | Keywords:
------------------------+---------------------
== Steps to reproduce ==

1. Open CKEditor with standard toolbar
2. Try going to commands for current instance and call command.disable()
for each item in commands
3. It will disable almost all but few buttons on toolbar

I have tried solution provided by garry.yao on the following link:
http://ckeditor.com/forums/CKEditor-3.x/How-make-CKEditor-readonly

== Expected result ==
I want way to disable font and fontsize button

== Actual result ==
No option available through commands collection

== Other details (browser, OS, CKEditor version, installed plugins) ==

--
Ticket URL: <http://dev.ckeditor.com/ticket/13852>
CKEditor <http://ckeditor.com/>
The text editor for the Internet

CKEditor

unread,
Nov 6, 2015, 10:32:28 AM11/6/15
to ckeditor...@googlegroups.com
#13852: There is no way to disable the font and fontsize button on the toolbar
--------------------------+-------------------

Reporter: ramendra | Owner:
Type: New Feature | Status: new
Priority: Normal | Milestone:
Component: General | Version: 4.5.4
Resolution: | Keywords:
--------------------------+-------------------
Changes (by j.swiderski):

* Attachment "table.png" added.

CKEditor

unread,
Nov 27, 2015, 8:14:24 AM11/27/15
to ckeditor...@googlegroups.com
#13852: There is no way to disable the font and fontsize button on the toolbar
--------------------------+-----------------------
Reporter: ramendra | Owner:
Type: New Feature | Status: confirmed
Priority: Normal | Milestone:
Component: General | Version: 4.0
Resolution: | Keywords:
--------------------------+-----------------------
Changes (by j.swiderski):

* status: new => confirmed
* version: 4.5.4 => 4.0


Comment:

Ok, to disable toolbar button, you can use api e.g.
{{{
editor.on('instanceReady', function(evt){
this.getCommand( 'justifyleft' ).disable();
this.getCommand( 'newpage' ).disable();
});
}}}

There is however no way to disable dropdowns. They don't use commands.
There could be either some api or dedicated method to do that (but then a
dedicated method for toolbar would have to be introduced).

--
Ticket URL: <http://dev.ckeditor.com/ticket/13852#comment:1>

CKEditor

unread,
Jul 7, 2017, 11:17:05 AM7/7/17
to ckeditor...@googlegroups.com
#13852: There is no way to disable the font and fontsize button on the toolbar
--------------------------+-----------------------
Reporter: ramendra | Owner:

Type: New Feature | Status: confirmed
Priority: Normal | Milestone:
Component: General | Version: 4.0
Resolution: | Keywords:
--------------------------+-----------------------

Comment (by j.swiderski):

Dropdowns are not related to commands so they can only be disabled through
{{{ui}}}. The problem with CKEditor default dropdowns is they are all
context sensitive so as soon as you hit any dropdown matching style, the
dropdown will get enabled again.
{{{
editor.on( 'instanceReady', function( evt ){
editor.ui.instances.FontSize.setState(CKEDITOR.TRISTATE_DISABLED);
});
}}}

The above workaround will only work on custom dropdowns which do not check
current selection in editor contents.

--
Ticket URL: <http://dev.ckeditor.com/ticket/13852#comment:2>

Reply all
Reply to author
Forward
0 new messages