Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

notifications - minor changes

DanielŻuławskife6a350fd77f
diff --git a/src/Web/Grand.Web/Views/Shared/_Notifications.cshtml b/src/Web/Grand.Web/Views/Shared/_Notifications.cshtml
index 472f2dae0..f2d4e9218 100644
--- a/src/Web/Grand.Web/Views/Shared/_Notifications.cshtml
+++ b/src/Web/Grand.Web/Views/Shared/_Notifications.cshtml
@@ -25,14 +25,14 @@
}
@foreach (var message in successMessages)
{
- <script asp-location="Footer" asp-order="300">
- displayPopupNotification('@Html.Raw(JavaScriptEncoder.Default.Encode(message))', 'success', false);
+ <script asp-location="Footer" asp-order="901">
+ vm.displayBarNotification('@Html.Raw(JavaScriptEncoder.Default.Encode(message))','', 'success', 3500);
</script>
}
@foreach (var message in errorMessages)
{
- <script asp-location="Footer" asp-order="300">
- displayPopupNotification('@Html.Raw(JavaScriptEncoder.Default.Encode(message))', 'error', false);
+ <script asp-location="Footer" asp-order="901">
+ vm.displayBarNotification('@Html.Raw(JavaScriptEncoder.Default.Encode(message))','', 'error', 3500);
</script>
}
diff --git a/src/Web/Grand.Web/wwwroot/theme/script/public.common.js b/src/Web/Grand.Web/wwwroot/theme/script/public.common.js
index e5082d97d..1a20e2dd8 100644
--- a/src/Web/Grand.Web/wwwroot/theme/script/public.common.js
+++ b/src/Web/Grand.Web/wwwroot/theme/script/public.common.js
@@ -138,72 +138,6 @@ function resetSelectedAddress() {
}
}
-function displayPopupNotification(message, messagetype) {
- //types: success, error
-
- //we do not encode displayed message
- var htmlcode = '';
- if ((typeof message) == 'string') {
- htmlcode = '<b-modal ref="grandModal" id="grandModal" centered hide-footer hide-header><div class="alert alert-info d-block mb-0">' + message + '</div></b-modal>';
- document.querySelector('.modal-place').innerHTML = htmlcode;
- new Vue({
- el: '#grandModal',
- data: {
- template: null,
- hover: false
- },
- render: function (createElement) {
- if (!this.template) {
- return createElement('b-overlay', {
- attrs: { show: 'true' }
- });
- } else {
- return this.template();
- }
- },
- methods: {
- showModal: function () {
- this.$refs['grandModal'].show()
- },
- },
- mounted: function () {
- var self = this;
- self.template = Vue.compile(htmlcode).render;
- },
- updated: function () {
- this.showModal();
- }
- });
- } else {
- new Vue({
- el: "#app",
- methods: {
- toast: function () {
- for (var i = 0; i < message.length; i++) {
- if (messagetype == 'error') {
- this.$bvToast.toast(message[i], {
- title: messagetype,
- variant: 'danger',
- autoHideDelay: 5000,
- })
- } else {
- this.$bvToast.toast(message[i], {
- title: messagetype,
- variant: 'info',
- autoHideDelay: 5000,
- })
- }
- }
- }
- },
- mounted: function () {
- this.toast();
- }
- });
-
- }
-}
-
function StopPropagation(event) {
event.stopPropagation();
}
@@ -239,7 +173,6 @@ function backToTop() {
}
document.addEventListener("DOMContentLoaded", function () {
-/* newsletterBox();*/
backToTop();
});