|
|
@@ -1017,9 +1017,8 @@ export default class Writer {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Temporarily (until selection won't be changed directly by the user or using `customRestorer`) disables default
|
|
|
- * gravity behaviour that tries to get attributes from nodes surrounding the caret. When gravity is marked
|
|
|
- * as overridden then attributes from the node before the caret won't be taken into consideration while
|
|
|
+ * Disables default gravity behaviour that tries to get attributes from nodes surrounding the caret. When gravity is
|
|
|
+ * marked as overridden then attributes from the node before the caret won't be taken into consideration while
|
|
|
* updating selection attributes.
|
|
|
*
|
|
|
* For the following model fragment:
|
|
|
@@ -1029,18 +1028,15 @@ export default class Writer {
|
|
|
* Selection attribute keys before override will be equal `[ 'bold', 'linkHref' ]`
|
|
|
* Selection attribute keys after override will be equal `[ 'bold' ]`
|
|
|
*
|
|
|
- * As default gravity is restored just after a direct {@link module:model/documentselection~DocumentSelection#change:range} event
|
|
|
- * but it could be customised using `customRestorer` callback:
|
|
|
+ * As default gravity is automatically restored just after a direct
|
|
|
+ * {@link module:model/documentselection~DocumentSelection#change:range} event but this behaviour can be disabled
|
|
|
+ * by passing `true` flag as param.
|
|
|
*
|
|
|
- * model.change( writer => {
|
|
|
- * writer.overrideSelectionGravity( restore => // and gravity won't be restored until `restore` callback won't be called ).
|
|
|
- * } );
|
|
|
- *
|
|
|
- * @param {Function} [customRestorer] A callback function that allows to control when default gravity should be restored.
|
|
|
- * Callback takes function as a param that allow to restore the gravity.
|
|
|
+ * @param {Boolean} [customRestore=false] When `true` then gravity won't be restored until
|
|
|
+ * {@link ~Writer#overrideSelectionGravity} will be called directly.
|
|
|
*/
|
|
|
- overrideSelectionGravity( customRestorer ) {
|
|
|
- this.model.document.selection._overrideGravity( customRestorer );
|
|
|
+ overrideSelectionGravity( customRestore ) {
|
|
|
+ this.model.document.selection._overrideGravity( customRestore );
|
|
|
}
|
|
|
|
|
|
/**
|