Skip to content

Commit bde29f8

Browse files
committed
Documented commandDef.readOnly and improved command and commandDef docs.
1 parent 081edb2 commit bde29f8

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

core/command.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* } );
1414
*
1515
* @class
16+
* @extends CKEDITOR.commandDefinition
1617
* @mixins CKEDITOR.event
1718
* @constructor Creates a command class instance.
1819
* @param {CKEDITOR.editor} editor The editor instance this command will be
@@ -35,6 +36,9 @@ CKEDITOR.command = function( editor, commandDefinition ) {
3536
*
3637
* command.exec(); // The command gets executed.
3738
*
39+
* **Note:** You should use the {@link CKEDITOR.editor#execCommand} method instead of calling
40+
* `command.exec()` directly.
41+
*
3842
* @param {Object} [data] Any data to pass to the command. Depends on the
3943
* command implementation and requirements.
4044
* @returns {Boolean} A boolean indicating that the command has been successfully executed.

core/commanddefinition.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@
7575
* editorFocus: false // The command doesn't require focusing the editing document.
7676
* } );
7777
*
78+
* See also {@link CKEDITOR.command#editorFocus}.
79+
*
7880
* @property {Boolean} [editorFocus=true]
79-
* @see CKEDITOR.command#editorFocus
8081
*/
8182

8283

@@ -134,6 +135,14 @@
134135
* modes: { wysiwyg:1 } // Command is available in wysiwyg mode only.
135136
* } );
136137
*
138+
* See also {@link CKEDITOR.command#modes}.
139+
*
137140
* @property {Object} [modes={ wysiwyg:1 }]
138-
* @see CKEDITOR.command#modes
141+
*/
142+
143+
/**
144+
* Whether the command should be enabled in the {@link CKEDITOR.editor#setReadOnly read-only mode}.
145+
*
146+
* @since 4.0
147+
* @property {Boolean} [readOnly=false]
139148
*/

0 commit comments

Comments
 (0)