Skip to content
Snippets Groups Projects
Commit 2083cdb6 authored by Kevin Jahns's avatar Kevin Jahns
Browse files

several bug-fixes (for y-richtext beta)

parent 20913920
No related branches found
No related tags found
No related merge requests found
...@@ -323,11 +323,27 @@ module.exports = function (Y /* : any*/) { ...@@ -323,11 +323,27 @@ module.exports = function (Y /* : any*/) {
ins.push(o) ins.push(o)
} }
}) })
this.waiting = []
// put in executable order // put in executable order
ins = notSoSmartSort(ins) ins = notSoSmartSort(ins)
ins.forEach(this.onevent) // this.onevent can trigger the creation of another operation
dels.forEach(this.onevent) // -> check if this.awaiting increased & stop computation if it does
this.waiting = [] for (var i = 0; i < ins.length; i++) {
if (this.awaiting === 0) {
this.onevent(ins[i])
} else {
this.waiting = this.waiting.concat(ins.slice(i))
break
}
}
for (var i = 0; i < dels.length; i++) {
if (this.awaiting === 0) {
this.onevent(dels[i])
} else {
this.waiting = this.waiting.concat(dels.slice(i))
break
}
}
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment