diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-06-16 16:43:59 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-06-16 16:43:59 +0700 |
| commit | ad3677ba03880180873f27ac18ba841b81b2db14 (patch) | |
| tree | 27583b6e5e9c52286e2ceb2761e5c1e9fe0f5e47 /web_notify/static/src/js/widgets/notification.js | |
| parent | e6e43d9e597551be2f8a1bad3fe400b60c102361 (diff) | |
Add web_notify addons
Diffstat (limited to 'web_notify/static/src/js/widgets/notification.js')
| -rw-r--r-- | web_notify/static/src/js/widgets/notification.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/web_notify/static/src/js/widgets/notification.js b/web_notify/static/src/js/widgets/notification.js new file mode 100644 index 0000000..0c468ff --- /dev/null +++ b/web_notify/static/src/js/widgets/notification.js @@ -0,0 +1,26 @@ +odoo.define("web_notify.Notification", function (require) { + "use strict"; + + var Notification = require("web.Notification"); + + Notification.include({ + icon_mapping: { + success: "fa-thumbs-up", + danger: "fa-exclamation-triangle", + warning: "fa-exclamation", + info: "fa-info", + default: "fa-lightbulb-o", + }, + init: function () { + this._super.apply(this, arguments); + // Delete default classes + this.className = this.className.replace(" o_error", ""); + // Add custom icon and custom class + this.icon = + this.type in this.icon_mapping + ? this.icon_mapping[this.type] + : this.icon_mapping.default; + this.className += " o_" + this.type; + }, + }); +}); |
