fixed inserting large xml portions

This commit is contained in:
Kevin Jahns
2017-10-27 22:28:32 +02:00
parent 1dea8f394f
commit c619aa33d9
6 changed files with 58 additions and 20 deletions

View File

@@ -123,8 +123,7 @@ export default class YArray extends Type {
}
}
insertAfter (left, content) {
const y = this._y
const apply = () => {
this._transact(y => {
let right
if (left === null) {
right = this._start
@@ -154,6 +153,8 @@ export default class YArray extends Type {
c._integrate(y)
} else if (left === null) {
this._start = c
} else {
left._right = c
}
left = c
} else {
@@ -172,12 +173,7 @@ export default class YArray extends Type {
if (prevJsonIns !== null && y !== null) {
prevJsonIns._integrate(y)
}
}
if (y !== null) {
y.transact(apply)
} else {
apply()
}
})
}
insert (pos, content) {
let left = null