From 5e51419383bd974a41acbeb17d2936f9ff36d0ed Mon Sep 17 00:00:00 2001 From: maliming Date: Tue, 21 Jan 2025 17:21:50 +0800 Subject: [PATCH] Update `abp-toast.js` to use fontawesome icons. --- .../toast/abp-toast.css | 6 ++-- .../toast/abp-toast.js | 31 +++++++------------ 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/toast/abp-toast.css b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/toast/abp-toast.css index 9840c6fce2..b6edbb0d6f 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/toast/abp-toast.css +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/toast/abp-toast.css @@ -16,13 +16,13 @@ grid-template-columns: 35px 1fr; gap: 5px; margin: 5px 0; - padding: 7px; + padding: 10px; width: 350px; user-select: none; z-index: 9999; color: #fff; border-radius: 8px; - font-size: 14px; + font-size: 16px; box-shadow: 0 0 20px 0 rgba(76, 87, 125, 0.02); animation: toastIn 0.3s ease-in-out; } @@ -54,7 +54,7 @@ } .abp-toast-icon .icon { - font-size: 32px; + font-size: 30px; } .abp-toast-content { diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/toast/abp-toast.js b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/toast/abp-toast.js index 115335e585..a23d844ce6 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/toast/abp-toast.js +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/toast/abp-toast.js @@ -73,12 +73,12 @@ AbpToastService.prototype.getIconClass = function(severity, options) { } const icons = { - success: 'bi-check', - info: 'bi-info-circle', - warning: 'bi-exclamation-triangle', - error: 'bi-shield-exclamation' + success: 'fa fa-check', + info: 'fa fa-info-circle', + warning: 'fa fa-exclamation-triangle', + error: 'fa fa-exclamation-circle' }; - return icons[severity] || 'bi-exclamation-triangle'; + return icons[severity] || 'fa fa-exclamation-triangle'; }; // Create toast DOM element @@ -88,14 +88,14 @@ AbpToastService.prototype.createToastElement = function(message, title, severity const closeButton = options.closable !== false ? `` : ''; const titleHtml = title ? `
${title}
` : ''; toast.innerHTML = `
- +
${closeButton} @@ -189,28 +189,19 @@ AbpToastService.setDefaultOptions = function(options) { var abp = abp || {}; (function () { - var toast; - - function getToast() { - if (!toast) { - toast = new AbpToastService(); - } - return toast; - } - abp.notify.success = function (message, title, options) { - getToast().success(message, title, options); + new AbpToastService().success(message, title, options); }; abp.notify.info = function (message, title, options) { - getToast().info(message, title, options); + new AbpToastService().info(message, title, options); }; abp.notify.warn = function (message, title, options) { - getToast().warning(message, title, options); + new AbpToastService().warning(message, title, options); }; abp.notify.error = function (message, title, options) { - getToast().error(message, title, options); + new AbpToastService().error(message, title, options); }; })(); \ No newline at end of file