- hide toast on click

This commit is contained in:
mortalis 2020-07-25 15:54:13 +02:00
parent 65b2619327
commit efa5decadf
2 changed files with 7 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@ -31,7 +31,12 @@ export const toast = function(msg, icon = null, dismiss = true, id = null) {
text: `<span class="toast-icon">${icon}</span><span class="toast-message">${msg}</toast>`, text: `<span class="toast-icon">${icon}</span><span class="toast-message">${msg}</toast>`,
duration: dismiss ? 3000 : 0, duration: dismiss ? 3000 : 0,
gravity: 'bottom', gravity: 'bottom',
position: 'left' position: 'left',
onClick: function(){
if (toastObj) {
toastObj.hideToast()
}
}
}).showToast() }).showToast()
if (id) { if (id) {
toastsWithId[id] = toastObj toastsWithId[id] = toastObj