sciactive / pnotify

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

Fix the attention function in animate #263

Closed octylFractal closed 7 years ago

octylFractal commented 8 years ago

If the in/out classes are left on, they will prevent attention from working.

aasiph commented 7 years ago

@kenzierocks your code fix is not working with the code below

var opts= {
                    text: "some message",
                    type: 'error',
                    animate: {
                        animate: true,
                        in_class: 'slideInLeft',
                        out_class: 'slideOutRight'
                    },
                    after_open: function(notice) {
                        notice.attention('swing');//this is not working
                    }
                };
               new PNotify(opts);

Please tell me if you have any alternate solution other than mine mentioned in thread at https://github.com/sciactive/pnotify/issues/265

octylFractal commented 7 years ago

Your patch is good because it allows attention to work in all cases: you should open a PR with it.

This patch also makes sense since it will keep the DOM clean of animation classes.