sciactive / pnotify

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

Uncaught RangeError: Maximum call stack size exceeded, when nonblock=true #285

Closed martin3043 closed 7 years ago

martin3043 commented 7 years ago

Chrome browser.

  1. nonblock=true causes stack exceeded error.

  2. The following is the PNotify call being used. new PNotify({ title: 'Message', text: 'My message', type: 'info', addclass: 'custom', shadow: true, nonblock: { nonblock: true, // true causes exception nonblock_opacity: .2 }, buttons: { show_on_nonblock: true, closer: true, closer_hover: false, sticker: false, sticker_hover: false
    }
    });

  3. I added 2 logging statements to the function - PNotify.prototype.modules.nonblock = { init: function(notice, options) in pnotify.custom.js .

            "mouseenter": function(e){
                if (that.options.nonblock) {
                    console.log("mouseenter - nonBlock=true");
    
           "mousemove": function(e){
                if (that.options.nonblock) {
                    console.log("mousemove - nonBlock=true");
  4. The pnotify window displays and the moment I move my mouse into the window the following occurs:

(multiple repeating lines) mouseenter - nonBlock=true jquery.pnotify.custom.min.js:1775 mousemove - nonBlock=true jquery.pnotify.custom.min.js:1744 mouseenter - nonBlock=true jquery.pnotify.custom.min.js:1775 mousemove - nonBlock=true jquery.pnotify.custom.min.js:1744 mouseenter - nonBlock=true jquery.pnotify.custom.min.js:1775 mousemove - nonBlock=true jquery.pnotify.custom.min.js:1695 Uncaught RangeError: Maximum call stack size exceeded. at HTMLDivElement.dom_event (jquery.pnotify.custom.min.js:1695) at nonblock_pass (jquery.pnotify.custom.min.js:1726) at HTMLDivElement.mousemove (jquery.pnotify.custom.min.js:1777) at HTMLDivElement.dispatch (jquery-1.7.2.min.js:3) at HTMLDivElement.i (jquery-1.7.2.min.js:3) at HTMLDivElement.dom_event (jquery.pnotify.custom.min.js:1695) at nonblock_pass (jquery.pnotify.custom.min.js:1728) at HTMLDivElement.mousemove (jquery.pnotify.custom.min.js:1777) at HTMLDivElement.dispatch (jquery-1.7.2.min.js:3) at HTMLDivElement.i (jquery-1.7.2.min.js:3)

  1. If I set nonblock=false. the problem does not occur.

Can you say what the problem might be.

Thanks.

Martin

martin3043 commented 7 years ago

The issue seems to be related to a missing nonblock section in the minimized version of the Pnotify css downloaded from the PNotify site - note the NonBlock module was selected. (PNotify CSS minify bug ?) To resolve, download the non-minimized PNotify CSS making sure to select the NonBlock module and then manually compress for the minified version.

hperrin commented 7 years ago

This is fixed in the new release.