Merge branch 'master' of github.com:y-js/yjs
This commit is contained in:
commit
0df0079fa3
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "yjs",
|
"name": "yjs",
|
||||||
"version": "13.0.0-54",
|
"version": "13.0.0-55",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "yjs",
|
"name": "yjs",
|
||||||
"version": "13.0.0-54",
|
"version": "13.0.0-55",
|
||||||
"description": "A framework for real-time p2p shared editing on any data",
|
"description": "A framework for real-time p2p shared editing on any data",
|
||||||
"main": "./y.node.js",
|
"main": "./y.node.js",
|
||||||
"browser": "./y.js",
|
"browser": "./y.js",
|
||||||
|
@ -8,6 +8,9 @@ export default class YXmlElement extends YXmlFragment {
|
|||||||
super()
|
super()
|
||||||
this.nodeName = null
|
this.nodeName = null
|
||||||
this._scrollElement = null
|
this._scrollElement = null
|
||||||
|
if (typeof arg2 === 'function') {
|
||||||
|
this._domFilter = arg2
|
||||||
|
}
|
||||||
if (typeof arg1 === 'string') {
|
if (typeof arg1 === 'string') {
|
||||||
this.nodeName = arg1.toUpperCase()
|
this.nodeName = arg1.toUpperCase()
|
||||||
} else if (arg1 != null && arg1.nodeType != null && arg1.nodeType === arg1.ELEMENT_NODE) {
|
} else if (arg1 != null && arg1.nodeType != null && arg1.nodeType === arg1.ELEMENT_NODE) {
|
||||||
@ -16,9 +19,6 @@ export default class YXmlElement extends YXmlFragment {
|
|||||||
} else {
|
} else {
|
||||||
this.nodeName = 'UNDEFINED'
|
this.nodeName = 'UNDEFINED'
|
||||||
}
|
}
|
||||||
if (typeof arg2 === 'function') {
|
|
||||||
this._domFilter = arg2
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
_copy () {
|
_copy () {
|
||||||
let struct = super._copy()
|
let struct = super._copy()
|
||||||
@ -39,7 +39,7 @@ export default class YXmlElement extends YXmlFragment {
|
|||||||
// get attribute via getAttribute for custom element support (some write something different in attr.value)
|
// get attribute via getAttribute for custom element support (some write something different in attr.value)
|
||||||
attributes.set(attr.name, dom.getAttribute(attr.name))
|
attributes.set(attr.name, dom.getAttribute(attr.name))
|
||||||
}
|
}
|
||||||
attributes = this._domFilter(dom, attributes)
|
attributes = this._domFilter(dom.nodeName, attributes)
|
||||||
attributes.forEach((value, name) => {
|
attributes.forEach((value, name) => {
|
||||||
this.setAttribute(name, value)
|
this.setAttribute(name, value)
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user