Merge branch 'master' into v13
This commit is contained in:
commit
dfe3b0b1d1
2
dist
2
dist
@ -1 +1 @@
|
|||||||
Subproject commit 3eafd78710a30cd01bf4c6b3553c141e7ac604a5
|
Subproject commit 42aa7ec5c9c0b4f2734b5b01eae7f0df63bfd9ff
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "yjs",
|
"name": "yjs",
|
||||||
"version": "12.3.0",
|
"version": "12.3.1",
|
||||||
"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": "./src/y.js",
|
"main": "./src/y.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
25
src/Utils.js
25
src/Utils.js
@ -29,9 +29,13 @@ export default function Utils (Y) {
|
|||||||
event.path = []
|
event.path = []
|
||||||
while (type != null && type._deepEventHandler != null) {
|
while (type != null && type._deepEventHandler != null) {
|
||||||
type._deepEventHandler.callEventListeners(event)
|
type._deepEventHandler.callEventListeners(event)
|
||||||
if (type._parent != null && type._parentSub != null) {
|
var parent = null
|
||||||
event.path = [type._parentSub].concat(event.path)
|
if (type._parent != null) {
|
||||||
type = type.os.getType(type._parent)
|
parent = type.os.getType(type._parent)
|
||||||
|
}
|
||||||
|
if (parent != null && parent._getPathToChild != null) {
|
||||||
|
event.path = [parent._getPathToChild(type._model)].concat(event.path)
|
||||||
|
type = parent
|
||||||
} else {
|
} else {
|
||||||
type = null
|
type = null
|
||||||
}
|
}
|
||||||
@ -476,7 +480,20 @@ export default function Utils (Y) {
|
|||||||
Default class of custom types!
|
Default class of custom types!
|
||||||
*/
|
*/
|
||||||
class CustomType {
|
class CustomType {
|
||||||
|
getPath () {
|
||||||
|
var parent = null
|
||||||
|
if (this._parent != null) {
|
||||||
|
parent = this.os.getType(this._parent)
|
||||||
|
}
|
||||||
|
if (parent != null && parent._getPathToChild != null) {
|
||||||
|
var firstKey = parent._getPathToChild(this._model)
|
||||||
|
var parentKeys = parent.getPath()
|
||||||
|
parentKeys.push(firstKey)
|
||||||
|
return parentKeys
|
||||||
|
} else {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Y.utils.CustomType = CustomType
|
Y.utils.CustomType = CustomType
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user