Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Fixed API docs - data model incorrect usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
ma2ciek committed Jun 13, 2018
1 parent e4b6704 commit 854aab1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/model/differ.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export default class Differ {
* @param {module:engine/model/range~Range|null} oldRange Marker range before the change or `null` if the marker has just
* been created.
* @param {module:engine/model/range~Range|null} newRange Marker range after the change or `null` if the marker was removed.
* @param {Boolean} affectsData Flag indicating whether marker affects the data model.
* @param {Boolean} affectsData Flag indicating whether marker affects the editor data.
*/
bufferMarkerChange( markerName, oldRange, newRange, affectsData ) {
const buffered = this._changedMarkers.get( markerName );
Expand Down Expand Up @@ -247,9 +247,9 @@ export default class Differ {
}

/**
* Checks whether some of buffered marker affects the data model or whether some element changed.
* Checks whether some of buffered marker affects the editor data or whether some element changed.
*
* @returns {Boolean} `true` if buffered markers or changes in elements affects the data model.
* @returns {Boolean} `true` if buffered markers or changes in elements affects the editor data.
*/
hasDataChanges() {
for ( const [ , change ] of this._changedMarkers ) {
Expand All @@ -258,7 +258,7 @@ export default class Differ {
}
}

// If markers do not affect the data model, check whether there are some changes in elements.
// If markers do not affect the data, check whether there are some changes in elements.
return this._changesInElement.size > 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/model/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export default class Document {
// Wait for `_change` event from model, which signalizes that outermost change block has finished.
// When this happens, check if there were any changes done on document, and if so, call post fixers,
// fire `change` event for features and conversion and then reset the differ.
// Fire `change:data` event when at least one operation or buffered marker changes the data model.
// Fire `change:data` event when at least one operation or buffered marker changes the data.
this.listenTo( model, '_change', ( evt, writer ) => {
if ( !this.differ.isEmpty || hasSelectionChanged ) {
this._callPostFixers( writer );
Expand Down
2 changes: 1 addition & 1 deletion src/model/markercollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ class Marker {
}

/**
* A value indicating if the marker changes the data model.
* A value indicating if the marker changes the data.
*
* @returns {Boolean}
*/
Expand Down
12 changes: 6 additions & 6 deletions src/model/writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -807,9 +807,9 @@ export default class Writer {
*
* addMarker( markerName, { range, usingOperation: true } );
*
* Create marker that does not affects the data model:
* Create marker that affects the editor data:
*
* addMarker( markerName, { range, usingOperation: false, affectData: false } );
* addMarker( markerName, { range, usingOperation: false, affectData: true } );
*
* Note: For efficiency reasons, it's best to create and keep as little markers as possible.
*
Expand All @@ -819,7 +819,7 @@ export default class Writer {
* @param {Boolean} options.usingOperation Flag indicating that the marker should be added by MarkerOperation.
* See {@link module:engine/model/markercollection~Marker#managedUsingOperations}.
* @param {module:engine/model/range~Range} options.range Marker range.
* @param {Boolean} [options.affectsData=false] Flag indicating that the marker changes the data model.
* @param {Boolean} [options.affectsData=false] Flag indicating that the marker changes the editor data.
* @returns {module:engine/model/markercollection~Marker} Marker that was set.
*/
addMarker( name, options ) {
Expand Down Expand Up @@ -879,7 +879,7 @@ export default class Writer {
* {@link module:engine/model/markercollection~Marker marker class description} to learn about the difference between
* markers managed by operations and not-managed by operations. It is possible to change this option for an existing marker.
*
* The `options.affectData` parameter allows you to inform the engine, that this marker affects the data model.
* The `options.affectData` parameter allows you to inform the engine, that this marker affects the editor data.
* It impacts the performance, because changes in markers with set `options.affectData:false` do not cause firing the
* {@link module:engine/model/document~Document#event:change:data `change:data`} event.
*
Expand All @@ -896,7 +896,7 @@ export default class Writer {
*
* updateMarker( marker, { usingOperation: true } );
*
* Change marker's option (inform the engine, that the marker does not affect the data model anymore):
* Change marker's option (inform the engine, that the marker does not affect the data anymore):
*
* updateMarker( markerName, { affectData: false } );
*
Expand All @@ -906,7 +906,7 @@ export default class Writer {
* @param {module:engine/model/range~Range} [options.range] Marker range to update.
* @param {Boolean} [options.usingOperation] Flag indicated whether the marker should be added by MarkerOperation.
* See {@link module:engine/model/markercollection~Marker#managedUsingOperations}.
* @param {Boolean} [options.affectsData] Flag indicating that the marker changes the data model.
* @param {Boolean} [options.affectsData] Flag indicating that the marker changes the editor data.
*/
updateMarker( markerOrName, options = {} ) {
this._assertWriterUsedCorrectly();
Expand Down

0 comments on commit 854aab1

Please sign in to comment.