mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Bug on notification click fixed
This commit is contained in:
@@ -86,4 +86,41 @@ export class ToastService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
async notificationMessage(message?: any, callback?: any,data?: any) {
|
||||
|
||||
let notification = document.createElement('div')
|
||||
notification.className = 'notificationPush'
|
||||
notification.innerHTML = `
|
||||
|
||||
<div class="main-content width-100 pa-20">
|
||||
<p class="message d-flex align-left">
|
||||
<p class="text">{{ message }}</p>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
`
|
||||
|
||||
let funcx = ()=>{
|
||||
callback(data);
|
||||
document.body.removeEventListener('click', funcx);
|
||||
notification.remove();
|
||||
}
|
||||
|
||||
document.body.append(notification)
|
||||
document.body.addEventListener('click', funcx);
|
||||
|
||||
notification.querySelector('.text').innerHTML = message || 'Processo efetuado'
|
||||
setTimeout(()=>{
|
||||
|
||||
notification.style.top = "-100%"
|
||||
|
||||
setTimeout(()=>{
|
||||
notification.remove()
|
||||
},1000)
|
||||
|
||||
},6000)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user