filter remote changes in YXml*

This commit is contained in:
Kevin Jahns
2017-11-26 14:39:47 -08:00
parent 2e3240b379
commit d0d1015074
7 changed files with 123 additions and 33 deletions

View File

@@ -153,12 +153,12 @@ export async function initArrays (t, opts) {
result['array' + i] = y.define('array', Y.Array)
result['map' + i] = y.define('map', Y.Map)
result['xml' + i] = y.define('xml', Y.XmlElement)
y.get('xml').setDomFilter(function (d, attrs) {
if (d.nodeName === 'HIDDEN') {
y.get('xml').setDomFilter(function (nodeName, attrs) {
if (nodeName === 'HIDDEN') {
return null
} else {
return attrs.filter(a => a !== 'hidden')
}
attrs.delete('hidden')
return attrs
})
y.on('afterTransaction', function () {
for (let missing of y._missingStructs.values()) {