sciactive / pnotify

Beautiful JavaScript notifications with Web Notifications support.
https://sciactive.com/pnotify/
Apache License 2.0
3.65k stars 513 forks source link

PNotify 2.0.1 Stick w/ after_close #271

Closed ray73864 closed 7 years ago

ray73864 commented 7 years ago

I know it is an older version, unfortunately it isn't a simple thing for me to just upgrade it at this point in time.

What I'm trying to do is show a stick notice (very simple, already done), and have an 'after_close' that will place the focus back onto an input box on the screen.

The issue I'm having is that if the user clicks on the 'x' to close the sticky notice, the after_close never executes, I have also tried before_close and after_open, none of them appear to be firing when the notice has 'hide: false'.

Example:

new PNotify({
        title: "PLEASE READ",
        text: "MESSAGE",
        type: "info",
        hide: false,
        after_close: function(notice, timer_hide) { 
          mainPageSearchBox.focus().val(""); alert("test"); 
        }
      });
ray73864 commented 7 years ago

Decided to just go and upgrade to 3.x which has resolved my issue.