Skip to content

Commit

Permalink
fix: 馃悰 trigger custom event
Browse files Browse the repository at this point in the history
  • Loading branch information
bubkoo committed Aug 18, 2020
1 parent 9feaafb commit 7389fe1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/x6/src/model/collection.ts
Expand Up @@ -303,10 +303,12 @@ export class Collection extends Basecoat<Collection.EventArgs> {
) {
const cell = args.cell
this.trigger(`cell:${name}`, args)
if (cell.isNode()) {
this.trigger(`node:${name}`, { ...args, node: this })
} else if (cell.isEdge()) {
this.trigger(`edge:${name}`, { ...args, edge: this })
if (cell) {
if (cell.isNode()) {
this.trigger(`node:${name}`, { ...args, node: this })
} else if (cell.isEdge()) {
this.trigger(`edge:${name}`, { ...args, edge: this })
}
}
}

Expand Down

0 comments on commit 7389fe1

Please sign in to comment.