|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function setFlashMessages(flashMessages){ |
|
|
function setFlashMessages(flashMessages){ |
|
|
|
|
|
var currentFlash =new Array(); |
|
|
for (var type in flashMessages) { |
|
|
for (var type in flashMessages) { |
|
|
for (var key in flashMessages[type]) { |
|
|
for (var key in flashMessages[type]) { |
|
|
generateNotice(type, flashMessages[type][key]); |
|
|
|
|
|
|
|
|
if(!currentFlash.includes(flashMessages[type][key])) { |
|
|
|
|
|
currentFlash.push(flashMessages[type][key]); |
|
|
|
|
|
generateNotice(type, flashMessages[type][key]); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function generateNotice(type, text) { |
|
|
function generateNotice(type, text) { |
|
|
$('#toast-container:before').on('click', function (){ |
|
|
|
|
|
alert('niche') |
|
|
|
|
|
}); |
|
|
|
|
|
toastr.options.timeOut = 3000000; |
|
|
|
|
|
toastr.options.extendedTimeOut = 3000000; |
|
|
|
|
|
|
|
|
|
|
|
toastr.options.preventDuplicates = true; |
|
|
|
|
|
|
|
|
toastr.options.timeOut = 3000; |
|
|
|
|
|
toastr.options.onHidden = function() { |
|
|
|
|
|
if($('#toast-container .toast').length==0)$('#toast-close-all').remove(); |
|
|
|
|
|
}; |
|
|
|
|
|
//toastr.options.preventDuplicates = true; |
|
|
toastr[type](text); |
|
|
toastr[type](text); |
|
|
|
|
|
|
|
|
|
|
|
if($('#toast-close-all').length==0) { |
|
|
|
|
|
$('#toast-container').prepend('<button id="toast-close-all"><i class="fa fa-times"></i></button>'); |
|
|
|
|
|
} |
|
|
|
|
|
$('#toast-close-all').off('click'); |
|
|
|
|
|
$('#toast-close-all').on('click', function (){ |
|
|
|
|
|
toastr.remove(); |
|
|
|
|
|
if($('#toast-container .toast').length==0)$('#toast-close-all').remove(); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
/*var n = noty({ |
|
|
/*var n = noty({ |
|
|
text: text, |
|
|
text: text, |
|
|
type: type, |
|
|
type: type, |