|
|
@@ -91,6 +91,18 @@ export default class Mapper {
|
|
|
return ModelPosition.createFromParentAndOffset( modelParent, modelOffset );
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Get corresponding view position.
|
|
|
+ *
|
|
|
+ * @param {treeModel.Position} modelPosition Model position.
|
|
|
+ * @returns {treeView.Position} Corresponding view position.
|
|
|
+ */
|
|
|
+ toViewPosition( modelPosition ) {
|
|
|
+ let viewContainer = this._modelToViewMapping.get( modelPosition.parent );
|
|
|
+
|
|
|
+ return this._findPositionIn( viewContainer, modelPosition.offset );
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Calculates model offset base on the view position and the block element.
|
|
|
*
|
|
|
@@ -169,18 +181,6 @@ export default class Mapper {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * Get corresponding view position.
|
|
|
- *
|
|
|
- * @param {treeModel.Position} modelPosition Model position.
|
|
|
- * @returns {treeView.Position} Corresponding view position.
|
|
|
- */
|
|
|
- toViewPosition( modelPosition ) {
|
|
|
- let viewContainer = this._modelToViewMapping.get( modelPosition.parent );
|
|
|
-
|
|
|
- return this._findPositionIn( viewContainer, modelPosition.offset );
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* Finds the position in the view node (or its children) with the expected model offset.
|
|
|
*
|