Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1234567891011121314151617181920212223242526272829303132333435
  1. export class Notification {
  2. static setNotifications(notifications) {
  3. var currentNotifications = new Array();
  4. for (var type in notifications) {
  5. for (var key in notifications[type]) {
  6. if (!currentNotifications.includes(notifications[type][key])) {
  7. currentNotifications.push(notifications[type][key]);
  8. self.addNotification(type, notifications[type][key]);
  9. }
  10. }
  11. }
  12. }
  13. static addNotification(type, text) {
  14. toastr.options.timeOut = 3000;
  15. toastr.options.onHidden = function () {
  16. if ($('#toast-container .toast').length == 0) $('#toast-close-all').remove();
  17. };
  18. toastr[type](text);
  19. if ($('#toast-close-all').length == 0) {
  20. $('#toast-container').prepend('<button id="toast-close-all"><i class="fa fa-times"></i></button>');
  21. }
  22. $('#toast-close-all').off('click');
  23. $('#toast-close-all').on('click', function () {
  24. toastr.remove();
  25. if ($('#toast-container .toast').length == 0) $('#toast-close-all').remove();
  26. });
  27. }
  28. }