Skip to content

Commit

Permalink
Merge pull request #766 from bartbutenaers/notification_output
Browse files Browse the repository at this point in the history
Notification output & output msg when button clicked
  • Loading branch information
joepavitt authored Apr 23, 2024
2 parents f1210b7 + 22afa6d commit 7d27e26
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions nodes/widgets/ui_notification.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
color: { value: null },
displayTime: { value: '3' },
showCountdown: { value: true },
outputs: { value: 0 },
outputs: { value: 1 },
allowDismiss: { value: 'OK' },
dismissText: { value: 'Close' },
raw: { value: false },
className: { value: '' },
name: { value: '' }
},
inputs: 1,
outputs: 0,
outputs: 1,
align: 'right',
icon: 'font-awesome/fa-envelope-o',
paletteLabel: 'notification',
Expand Down
7 changes: 4 additions & 3 deletions ui/src/widgets/ui-notification/UINotification.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<template v-if="props.allowDismiss" #actions>
<v-btn
variant="text"
@click="close"
@click="close('clicked')"
>
{{ props.dismissText || "Close" }}
</v-btn>
Expand Down Expand Up @@ -84,7 +84,7 @@ export default {
this.timeouts.close = setTimeout(() => {
// close the notification after time has elapsed
this.close()
this.close('timeout')
}, time)
// update the progress bar every 100ms
Expand All @@ -96,8 +96,9 @@ export default {
this.countdown = 100 - (elapsed / parseFloat(this.props.displayTime)) * 100
}, 100)
},
close () {
close (payload) {
this.show = false
this.$socket.emit('widget-action', this.id, payload)
clearTimeout(this.timeouts.close)
clearInterval(this.timeouts.step)
Expand Down

0 comments on commit 7d27e26

Please sign in to comment.