allow closing notifications on click

This commit is contained in:
Géry Debongnie
2019-01-29 20:42:05 +01:00
parent 0bbeabd55c
commit 0b3dc0301e
4 changed files with 80 additions and 33 deletions
+5 -1
View File
@@ -4,7 +4,7 @@ import { INotification } from "../services/notifications";
const template = `
<div class="o_notification">
<a t-if="props.sticky" class="fa fa-times o_close" href="#" title="Close" aria-label="Close"/>
<a t-if="props.sticky" class="fa fa-times o_close" href="#" title="Close" aria-label="Close" t-on-click="close"/>
<div class="o_notification_title">
<t t-raw="props.title"/>
</div>
@@ -17,4 +17,8 @@ const template = `
export class Notification extends Widget<Env, INotification> {
name = "notification";
template = template;
close() {
this.env.notifications.close(this.props!.id);
}
}