alexcrack / angular-ui-notification

Angular.js service providing simple notifications using Bootstrap 3 styles with css transitions for animating
MIT License
536 stars 169 forks source link

The notification hide but when mouse over on position, the notification appear #119

Open BodasDeSangre opened 7 years ago

BodasDeSangre commented 7 years ago

Hi,

I have a problem with the notification, When a notification is shown, it show for a time an then it's dissapear, it's ok.

But when I put the mouse over the posittion of the notification was shown, It come back! :(.

Can you help me with this issue please.

mcblum commented 7 years ago

+1. Same thing for us. Maybe we're missing a command to hide them or something?

mcblum commented 7 years ago

@BodasDeSangre actually, I just figured it out. It says in the docs that any notification show method returns a promise and with that response, the method to kill the notification. Try something like this:

 show(message, params) {
        this.NotificationLibrary({
            delay: 4000,
            type: params.type,
            message: message,
            closeOnClick: true,
            onClose: this.messageClosed
        }).then((response) => {
            this.$timeout(() => {
                response.kill(true);
            }, 5000)
        })
    }

This works for me and the messagedClosed callback fires and the message is removed from the dom.