jQuery(function($) { $('#id-toast-removeall').on('click', function() { $.aceToaster.removeAll() // $.aceToaster.removeAll(null, true) // `true` means remove instantly }) /** document.addEventListener('add.ace.toaster', function(e) { // triggered when a new toast is made // e.target }) document.addEventListener('clear.ace.toaster', function(e) { // this is triggered when hideAll/removeAll is called // you can prevent them with `e.preventDefault()` // `e.detail` has the following // String: e.detail.placement // Boolean: e.detail.remove (i.e remove or just hide) }) */ $('#id-toast-default').on('click', function() { $.aceToaster.add({ placement: 'tc', title: 'Notification message!', body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', icon: '\ \ ', iconClass: 'mt-3', delay: 5000, closeClass: 'btn btn-light-danger border-0 btn-bgc-tp btn-xs px-2 py-0 text-150 position-tr mt-n25', className: 'bgc-white-tp1 border-none border-t-4 brc-primary-tp1 rounded-sm pl-3 pr-1', headerClass: 'bg-transparent border-0 text-120 text-blue-d3 font-bolder mt-3', bodyClass: 'pt-0 pb-3 text-105' }) }) $('#id-toast-info').on('click', function() { $.aceToaster.add({ placement: 'tr', body: "
\
\
\
\
Lorem ipsum dolor sit amet, consectetur adipiscing elit!\
\
\
\
\
Lorem ipsum dolor sit amet, consectetur adipiscing elit!\
\
\
\
\
Lorem ipsum dolor sit amet, consectetur adipiscing elit!\
\ \ \
', width: '420px', sticky: true, belowNav: true, closeClass: 'btn btn-bgc-tp border-0 btn-light-danger btn-xs px-2 py-1px m2-px radius-1 text-100 font-normal position-tr mt-2px mr-2px', //icon: '', headerClass: 'bgc-transparent border-0 text-white text-140 mb-3 p-0 pl-3 pr-4', titleClass: 'text-dark-tp3 font-normal pt-15', className: 'brc-success-m1 border-1 border-t-4 radius-0 pr-0', bodyClass: 'pt-0 pl-3 text-105' }) // enable dragging using interact.js toast.style.touchAction = 'none' var position = { x: 0, y: 0 } interact(toast) .draggable({ ignoreFrom: '.btn', //for Firefox on Android to react to button events listeners: { move : function(event) { position.x += event.dx position.y += event.dy Object.assign(event.target.style, { transform: "translateX("+position.x+"px) translateY("+position.y+"px)" }) }, } }) }) //////////////// $('#id-sweeralert-1').on('click', function() { var swalWithBootstrapButtons = Swal.mixin({ buttonsStyling: false }) swalWithBootstrapButtons.fire({ title: 'Are you sure?', text: "You won't be able to revert this!", type: 'warning', showCancelButton: true, scrollbarPadding: false, confirmButtonText: 'Yes, do it!', cancelButtonText: 'No, cancel!', reverseButtons: true, customClass: {'confirmButton': 'btn btn-green mx-2 px-3', 'cancelButton': 'btn btn-red mx-2 px-3'} }).then(function(result) { if (result.value) { swalWithBootstrapButtons.fire({ title: 'Deleted!', text: 'Operation completed successfully.', type: 'success', icon: 'success', customClass: {'confirmButton': 'btn btn-info px-5'} }) } else if ( result.dismiss === Swal.DismissReason.cancel ) { swalWithBootstrapButtons.fire({ title: 'Cancelled', text: 'Cancelled successfully.', type: 'error', icon: 'error', customClass: {'confirmButton': 'btn btn-secondary px-5'} }) } }) }) $('#id-sweeralert-2').on('click', function() { Swal.fire({ position: 'top-end', scrollbarPadding: false, type: 'info', title: 'Your work has been saved', showConfirmButton: false, timer: 2000 }) }) })