Przeglądaj źródła

Docs: Improved documentation of various restricted editing classes.

Aleksander Nowodzinski 6 lat temu
rodzic
commit
e122ba66a6

+ 6 - 0
packages/ckeditor5-restricted-editing/src/restrictededitingediting.js

@@ -14,6 +14,12 @@ import RestrictedEditingNavigationCommand from './restrictededitingnavigationcom
 const HIGHLIGHT_CLASS = 'ck-restricted-editing-exception_selected';
 
 /**
+ * The Restricted Editing editing feature.
+ *
+ * * It introduces the exception marker group that renders to `<spans>` with the `ck-restricted-editing-exception` CSS class.
+ * * It registers the `'goToPreviousRestrictedEditingRegion'` and `'goToNextRestrictedEditingRegion'` commands.
+ * * Also enables highlighting exception markers that are selected.
+ *
  * @extends module:core/plugin~Plugin
  */
 export default class RestrictedEditingEditing extends Plugin {

+ 3 - 2
packages/ckeditor5-restricted-editing/src/restrictededitingnavigationcommand.js

@@ -10,7 +10,7 @@
 import Command from '@ckeditor/ckeditor5-core/src/command';
 
 /**
- * The command that allows navigation across the exceptions in the editor content.
+ * The command that allows navigation across the exceptions in the edited document.
  *
  * @extends module:core/command~Command
  */
@@ -101,7 +101,8 @@ function getNearestExceptionPosition( model, direction ) {
 		return null;
 	}
 
-	// Get the marker closest to the selection position among many.
+	// Get the marker closest to the selection position among many. To know that, we need to sort
+	// them first.
 	return markerStartPositions.sort( ( posA, posB ) => {
 		if ( direction === 'forward' ) {
 			return posA.isAfter( posB ) ? 1 : -1;

+ 5 - 0
packages/ckeditor5-restricted-editing/src/restrictededitingui.js

@@ -14,6 +14,11 @@ import lockIcon from '../theme/icons/contentlock.svg';
 import Collection from '@ckeditor/ckeditor5-utils/src/collection';
 
 /**
+ * The Restricted Editing UI feature.
+ *
+ * It introduces the `'restrictedEditing'` dropdown that offers tools to navigate exceptions across
+ * the document.
+ *
  * @extends module:core/plugin~Plugin
  */
 export default class RestrictedEditingUI extends Plugin {