Ticket #8959 (closed Task: invalid)

Opened 3 years ago

Last modified 3 years ago

How to make particular custom buttons/command enabled in readonly mode

Reported by: enorth Owned by:
Priority: Normal Milestone:
Component: UI : Skins Version: 3.6.3
Keywords: Cc:


I noticed that when you make the editor readonly some of the command buttons (such as copy, preview, full screen) stay enabled. I have two questions:

  1. What class/property do I need to set for my user-defined, custom buttons/commands (plugins) to have them behave this way?
  2. How can I override this behavior. In other words, make copy, preview, full screen disabled when the editor is readonly.

I had some partial success. I tried adding a class called "alwaysEnabled" when creating the button (editor.ui.addButton). Then after I made the editor readonly, I executed this command:


This made it "appear" enabled, but the command still din not fire.

thanks for help.

Change History

comment:1 Changed 3 years ago by enorth

  • Type changed from Bug to Task
  • Version set to 3.6.3
  • Component changed from General to UI : Skins

comment:3 Changed 3 years ago by j.swiderski

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

Please refer to the following article for information on where to get support for all issues related to CKEditor: http://docs.cksource.com/CKEditor_3.x/Howto/Support

Also try using our forums for advice: http://cksource.com/forums/

If you are looking for professional assistance, the CKEditor development team is available via a dedicated support channel that is included in all our commercial licenses: http://ckeditor.com/license

Further more I believe that it was answered on forum:

Whether a custom plugin will be disabled in read-only depends on your plugin's definitions. The Source, Preview, etc., buttons are attached to editor "commands" and they reflect the command "state".

When defining a command it is possible to mark it as valid for read-only, by setting the readOnly property of the command definition to 1 or true.

For example, you can see this happening on the preview plugin code, at line 16:


So I guess the class/property you are looking for is readOnly : 1 in your plugin's js file.

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