From 9456370077a1648bba0a67e1c5a1bf2b6f427dec Mon Sep 17 00:00:00 2001 From: Alex M Date: Sat, 8 Oct 2016 21:36:31 +0300 Subject: [PATCH] [Notifications] Extract minimize and dismiss logic --- .../notification/src/NotificationService.js | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/platform/commonUI/notification/src/NotificationService.js b/platform/commonUI/notification/src/NotificationService.js index 39104faca3..9765698343 100644 --- a/platform/commonUI/notification/src/NotificationService.js +++ b/platform/commonUI/notification/src/NotificationService.js @@ -208,10 +208,15 @@ define( * @private */ NotificationService.prototype.dismissOrMinimize = function (notification) { - if (notification.minimizeInsteadOfDismiss) { - notification.minimize(); + var model = notification.model; + if (model.severity === "info") { + if (model.autoDismiss === false) { + notification.minimize(); + } else { + notification.dismiss(); + } } else { - notification.dismiss(); + notification.minimize(); } }; @@ -341,16 +346,6 @@ define( return notificationModel.autoDismiss; } return self.AUTO_DISMISS_TIMEOUT; - })(), - - minimizeInsteadOfDismiss: (function () { - if (notificationModel.severity === "info") { - if (notificationModel.autoDismiss === false) { - return true; - } - return false; - } - return true; })() };