Opened 12 years ago

Closed 12 years ago

#8959 closed Task (invalid)

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:

Description

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:

$(".alwaysEnabled").removeClass("cke_disabled");

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

thanks for help.

Change History (3)

comment:1 Changed 12 years ago by enorth

Component: GeneralUI : Skins
Type: BugTask
Version: 3.6.3

comment:3 Changed 12 years ago by Jakub Ś

Resolution: invalid
Status: newclosed

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:

http://dev.ckeditor.com/browser/CKEditor/trunk/_source/plugins/preview/plugin.js

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 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy