Skip to content

Commit 375403c

Browse files
authored
Merge pull request #822 from shital-orchestral/notification-pop-up-close
notification popup close on button click
2 parents 294e211 + c893c9c commit 375403c

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

modules/st2-notification/notification.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -83,21 +83,24 @@ export class Notification {
8383
onClick: () => router.push({ pathname: `/history/${execution_id}` }),
8484
});
8585
}
86-
87-
return new Noty({
86+
const notificationObj = new Noty({
8887
text,
8988
type,
9089
layout: 'bottomLeft',
91-
closeWith: [ 'click' ],
92-
timeout: 3000,
90+
closeWith:[ 'click', 'button' ],
91+
timeout: 9000,
9392
buttons: buttons.map(({ text, className, onClick, ...attributes }) => Noty.button(
9493
text,
9594
`st2-forms__button st2-forms__button--skeleton ${className || ''}`,
96-
onClick,
95+
() => {
96+
onClick();
97+
notificationObj.close();
98+
},
9799
attributes,
98100
)),
99101
...options,
100-
}).show();
102+
});
103+
return notificationObj.show();
101104
}
102105
}
103106

0 commit comments

Comments
 (0)