2021-09-24 11:58:42 +02:00
|
|
|
import Component from "@ember/component";
|
2021-11-01 14:52:29 +01:00
|
|
|
import NoticeMessage from "../mixins/notice-message";
|
2021-09-24 11:58:42 +02:00
|
|
|
|
2021-11-01 14:52:29 +01:00
|
|
|
export default Component.extend(NoticeMessage, {
|
|
|
|
attributeBindings: ["notice.id:data-notice-id"],
|
2021-11-17 13:48:11 +01:00
|
|
|
classNameBindings: [
|
|
|
|
":wizard-notice",
|
|
|
|
"notice.typeClass",
|
|
|
|
"notice.dismissed:dismissed",
|
|
|
|
"notice.expired:expired",
|
|
|
|
"notice.hidden:hidden",
|
|
|
|
],
|
2021-09-24 11:58:42 +02:00
|
|
|
|
|
|
|
actions: {
|
|
|
|
dismiss() {
|
2021-10-19 14:49:06 +02:00
|
|
|
this.set("dismissing", true);
|
2021-09-24 11:58:42 +02:00
|
|
|
this.notice.dismiss().then(() => {
|
2021-10-19 14:49:06 +02:00
|
|
|
this.set("dismissing", false);
|
2021-09-24 11:58:42 +02:00
|
|
|
});
|
2021-10-19 14:49:06 +02:00
|
|
|
},
|
2021-11-01 14:52:29 +01:00
|
|
|
|
|
|
|
hide() {
|
2021-11-17 13:48:11 +01:00
|
|
|
this.set("hiding", true);
|
2021-11-01 14:52:29 +01:00
|
|
|
this.notice.hide().then(() => {
|
2021-11-17 13:48:11 +01:00
|
|
|
this.set("hiding", false);
|
2021-11-01 14:52:29 +01:00
|
|
|
});
|
|
|
|
},
|
2021-11-17 13:48:11 +01:00
|
|
|
},
|
2021-10-19 14:49:06 +02:00
|
|
|
});
|