Opened 3 years ago

Closed 3 years ago

#14685 closed Bug (invalid)

Restoring editor to the editable mode should respect command buttons state

Reported by: mdprw Owned by:
Priority: Normal Milestone:
Component: Core : Read-only Version:
Keywords: Cc:

Description

Steps to reproduce

  1. Open any CKEditor full featured:
http://nightly.ckeditor.com/full/samples/
  1. Disable templates command button:
CKEDITOR.instances.editor.commands.templates.disable();
  1. Set editor to readOnly mode:
CKEDITOR.instances.editor.setReadOnly();
  1. Set editor to editable mode:
CKEDITOR.instances.editor.setReadOnly(false);

Expected result

Previously disabled command buttons should mantain their state

Actual result

The command button is enabled

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

OS: Windows 7 Browser: Firefox 46.0.1 CKEditor: 4.5.9

Change History (1)

comment:1 Changed 3 years ago by Jakub Ś

Resolution: invalid
Status: newclosed
Version: 4.5.9

You could always use http://docs.ckeditor.com/#!/api/CKEDITOR.editor-event-readOnly event to customize this behaviour, and this is implementer part to maintain custom parts here. In general it's preferred to automatically maintain command status with http://docs.ckeditor.com/#!/api/CKEDITOR.commandDefinition-property-readOnly

Please also note that some buttons are disabled before and after setting read-only. They handle their state managing CKEDITOR.TRISTATE_DISABLED and CKEDITOR.TRISTATE_OFF. Please check the indent, link (unlink) or clipboard plugins.

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