New types dont fire events - fixes #155

This commit is contained in:
Kevin Jahns
2019-06-18 17:41:19 +02:00
parent 1faff323c1
commit 1aac245b93
4 changed files with 55 additions and 14 deletions

View File

@@ -120,7 +120,6 @@ export class ContentType {
}
})
transaction.changed.delete(this.type)
transaction.changedParentTypes.delete(this.type)
}
/**
* @param {StructStore} store

View File

@@ -22,6 +22,7 @@ import {
readContentEmbed,
readContentFormat,
readContentType,
addChangedTypeToTransaction,
ContentType, ContentDeleted, StructStore, ID, AbstractType, Transaction // eslint-disable-line
} from '../internals.js'
@@ -237,7 +238,8 @@ export class Item extends AbstractStruct {
}
addStruct(store, this)
this.content.integrate(transaction, this)
maplib.setIfUndefined(transaction.changed, parent, set.create).add(parentSub)
// add parent to transaction.changed
addChangedTypeToTransaction(transaction, parent, parentSub)
if ((parent._item !== null && parent._item.deleted) || (this.right !== null && parentSub !== null)) {
// delete if parent is deleted or if this is not the current attribute value of parent
this.delete(transaction)