Skip to content

Commit

Permalink
if type is event emit event through bus event with the action as name
Browse files Browse the repository at this point in the history
  • Loading branch information
ValJed committed Dec 16, 2024
1 parent e9f014a commit 80f14d0
Showing 1 changed file with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,6 @@ export default {
] : [])
];

for (const additionalMenuItem of this.additionalMenuItems) {
menu.push(additionalMenuItem);
}

return menu;
},
customMenusByContext() {
Expand Down Expand Up @@ -403,11 +399,6 @@ export default {
this.customAction(this.context, operation);
return;
}
const additionalItem = this.additionalMenuItems.find(item => item.action === action);
if (additionalItem?.emitEvent) {
this.$emit('close', this.context, additionalItem.action);
return;
}

this[action](this.context);
},
Expand Down Expand Up @@ -464,6 +455,10 @@ export default {
...docProps(doc),
...operation.props
};
if (operation.type === 'event') {
apos.bus.$emit(operation.action, props);
return;
}
await apos.modal.execute(operation.modal, props);
function docProps(doc) {
return Object.fromEntries(Object.entries(operation.docProps || {}).map(([ key, value ]) => {
Expand Down

0 comments on commit 80f14d0

Please sign in to comment.