Browse Source

Fixed toastr problem

pull/148/head
Yunus Emre Kalkan 1 year ago
parent
commit
6fdbe72fbb
  1. 21
      src/EventHub.Web/Pages/Events/Components/CreateOrEditEventArea/create-or-edit-event-area.js

21
src/EventHub.Web/Pages/Events/Components/CreateOrEditEventArea/create-or-edit-event-area.js

@ -1,8 +1,11 @@
(function () { (function () {
abp.widgets.CreateOrEditEventArea = function ($wrapper) { abp.widgets.CreateOrEditEventArea = function ($wrapper) {
var l = abp.localization.getResource('EventHub'); var l = abp.localization.getResource('EventHub');
toastr.options.timeOut = 500;
toastr.options.preventDuplicates = true; AbpToastService.setDefaultOptions({
life: 5000,
closable: true
});
var stepType = { var stepType = {
"Event": "Event", "Event": "Event",
@ -74,16 +77,18 @@
if (eventIdInput.val().length === 36) { if (eventIdInput.val().length === 36) {
abp.notify.success('Updated event'); abp.notify.success('Updated event');
}else{ }else{
abp.notify.success('Created event as a draft' , '', toastr.options.timeOut = 2500); abp.notify.success('Created event as a draft' , '', {
life: 2500
});
eventIdInput.val(response.id); eventIdInput.val(response.id);
eventUrlCodeInput.val(response.urlCode); eventUrlCodeInput.val(response.urlCode);
} }
SwitchToTrackCreation() SwitchToTrackCreation()
}, },
error: function (errorRaw) { error: function (errorRaw) {
abp.notify.error(errorRaw.responseJSON.error.message, 'Error', abp.notify.error(errorRaw.responseJSON.error.message, 'Error',
toastr.options = { {
timeOut: 2500, life: 2500,
progressBar: true, progressBar: true,
positionClass: "toast-bottom-right" positionClass: "toast-bottom-right"
} }
@ -385,8 +390,8 @@
abp.notify.error( abp.notify.error(
error.message, error.message,
'Error', 'Error',
toastr.options = { {
timeOut: 2500, life: 2500,
progressBar: true, progressBar: true,
positionClass: "toast-bottom-right" positionClass: "toast-bottom-right"
} }

Loading…
Cancel
Save