You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
851 B

  1. odoo.define('web_notify.Notification', function (require) {
  2. "use strict";
  3. var Notification = require('web.Notification');
  4. Notification.include({
  5. icon_mapping: {
  6. 'success': 'fa-thumbs-up',
  7. 'danger': 'fa-exclamation-triangle',
  8. 'warning': 'fa-exclamation',
  9. 'info': 'fa-info',
  10. 'default': 'fa-lightbulb-o',
  11. },
  12. init: function () {
  13. this._super.apply(this, arguments);
  14. // Delete default classes
  15. this.className = this.className.replace(' o_error', '');
  16. // Add custom icon and custom class
  17. this.icon = (this.type in this.icon_mapping) ?
  18. this.icon_mapping[this.type] :
  19. this.icon_mapping['default'];
  20. this.className += ' o_' + this.type;
  21. },
  22. });
  23. });