[Notifications] Extract minimize and dismiss logic

This commit is contained in:
Alex M
2016-10-08 21:36:31 +03:00
parent e19edbb27a
commit 9456370077

View File

@@ -208,11 +208,16 @@ define(
* @private
*/
NotificationService.prototype.dismissOrMinimize = function (notification) {
if (notification.minimizeInsteadOfDismiss) {
var model = notification.model;
if (model.severity === "info") {
if (model.autoDismiss === false) {
notification.minimize();
} else {
notification.dismiss();
}
} else {
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;
})()
};