Merge branch 'master' into v13

This commit is contained in:
Kevin Jahns
2017-06-19 10:48:16 +02:00
3 changed files with 23 additions and 6 deletions

View File

@@ -29,9 +29,13 @@ export default function Utils (Y) {
event.path = []
while (type != null && type._deepEventHandler != null) {
type._deepEventHandler.callEventListeners(event)
if (type._parent != null && type._parentSub != null) {
event.path = [type._parentSub].concat(event.path)
type = type.os.getType(type._parent)
var parent = null
if (type._parent != null) {
parent = type.os.getType(type._parent)
}
if (parent != null && parent._getPathToChild != null) {
event.path = [parent._getPathToChild(type._model)].concat(event.path)
type = parent
} else {
type = null
}
@@ -476,7 +480,20 @@ export default function Utils (Y) {
Default class of custom types!
*/
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