Просмотр исходного кода

fix(alerts): added alert listener for appEvents

Torkel Ödegaard 9 лет назад
Родитель
Сommit
9c0f7f547b
1 измененных файлов с 3 добавлено и 4 удалено
  1. 3 4
      public/app/core/services/alert_srv.ts

+ 3 - 4
public/app/core/services/alert_srv.ts

@@ -27,10 +27,9 @@ export class AlertSrv {
       this.set(alert[0], alert[1], 'success', 3000);
     }, this.$rootScope);
 
-    appEvents.on('alert-error', options => {
-      this.set(options[0], options[1], 'error', 7000);
-    });
-
+    appEvents.on('alert-warning', options => this.set(options[0], options[1], 'warning', 5000));
+    appEvents.on('alert-success', options => this.set(options[0], options[1], 'success', 3000));
+    appEvents.on('alert-error', options => this.set(options[0], options[1], 'error', 7000));
     appEvents.on('confirm-modal', this.showConfirmModal.bind(this));
   }