make DocumentOffset compatible with what is returned from dom/getCaret

so we can return a DocumentOffset from there without breakage
pull/21833/head
Bruno Windels 2019-09-03 15:58:05 +02:00
parent 917700a1fc
commit 648ae37ff4
1 changed files with 3 additions and 3 deletions

View File

@ -15,12 +15,12 @@ limitations under the License.
*/
export default class DocumentOffset {
constructor(offset, atEnd) {
constructor(offset, atNodeEnd) {
this.offset = offset;
this.atEnd = atEnd;
this.atNodeEnd = atNodeEnd;
}
asPosition(model) {
return model.positionForOffset(this.offset, this.atEnd);
return model.positionForOffset(this.offset, this.atNodeEnd);
}
}