From b83e6170a4df0960bd12290d9caae89014e66c23 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Thu, 15 Jun 2023 11:08:29 +0300 Subject: [PATCH] notify error support options --- client/src/ui.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/client/src/ui.js b/client/src/ui.js index ef15e6ff38..cad60c2b49 100644 --- a/client/src/ui.js +++ b/client/src/ui.js @@ -1099,13 +1099,16 @@ Espo.Ui = { * Show an error message. * * @param {string} message A message. - * @param {boolean} [closeButton] A close button. + * @param {Espo.Ui~NotifyOptions|true} [options] Options. If true, then only closeButton option will be applied. */ - error: function (message, closeButton) { - closeButton = closeButton || false; - let timeout = closeButton ? 0 : 4000; + error: function (message, options) { + options = typeof options === 'boolean' ? + {closeButton: options} : + {...options}; - Espo.Ui.notify(message, 'danger', timeout, {closeButton: closeButton}); + let timeout = options.closeButton ? 0 : 4000; + + Espo.Ui.notify(message, 'danger', timeout, options); }, /**