fix path bugs

This commit is contained in:
Kevin Jahns
2017-11-10 12:54:33 -08:00
parent d232b883e9
commit 0cda1630d2
8 changed files with 47 additions and 38 deletions

View File

@@ -1,5 +1,6 @@
import Type from '../Struct/Type.js'
import ItemJSON from '../Struct/ItemJSON.js'
import ItemString from '../Struct/ItemString.js'
import { logID } from '../MessageHandler/messageToString.js'
import YEvent from '../Util/YEvent.js'
@@ -19,7 +20,11 @@ export default class YArray extends Type {
while (n !== null) {
if (!n._deleted) {
if (pos < n._length) {
return n._content[n._length - pos]
if (n.constructor === ItemJSON || n.constructor === ItemString) {
return n._content[pos]
} else {
return n
}
}
pos -= n._length
}

View File

@@ -255,7 +255,7 @@ export default class YXmlFragment extends YArray {
}
})
for (let dom of diffChildren) {
if (dom._yxml != null) {
if (dom._yxml != null && dom._yxml !== false) {
applyChangesFromDom(dom)
}
}