sciactive / pnotify

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

Unable to remove inital non-block PNotify notification after setup #287

Closed neoyeowyang closed 6 years ago

neoyeowyang commented 7 years ago

After setup (including the required .css and .js), I am unable to figure out how to remove the initial PNotify notification.

Did some tweaks with body onload -> "PNotify.removeAll();" but doesn't seem like the legit manner and upon hovering over the spot of the initial PNotify, it comes back.

I've also tried re-downloading the .css and .js without checking the non-block in non minified and minified versions but the initial PNotify was still there.

Been looking high and low but doesn't seem like anyone having the same issue as me or perhaps its just me. Appreciate any help or pointers, thank you!

ghost commented 7 years ago

Hola, buenas noches,

Yo también tenía el mismo problema y lo acabo de solucionar, primero noté que cuando abría la consola de desarrollador de chrome aparecía un mensaje init_PNotify. Empecé a buscar de donde aparecía este mensaje y provenía de un archivo en mi caso llamado "custom.min.js", que iniciaba una función llamada init_PNotify y lo que hace es crear esa molesta notificación, entonces elimine la función y con eso logré eliminar la notificación. Espero sea de tu ayuda Saludos

English version (Google translate) :) Hi, first sorry for my english. I also had the same problem and I just solved it, first I noticed that when I opened the chrome developer console I was shown an init_PNotify message. I started looking for where this message appeared and came from a file in my case called "custom.min.js", which started a function called init_PNotify and what it does is create that annoying notification, then delete the function and with that I managed to eliminate the notification. I hope it's your help. regards

vvarchild commented 7 years ago

up for this.. I had the same issue. Not being productive because of solving this problem. I already did what is said by @Giussep07 but it did not work for me the notification still pop up as if it was not deleted I tried to pinpoint other possible file but Jesus Christ I can't find it. Please help. I'm using the "custom.min.js" too..

hperrin commented 7 years ago

How are you including the JS in your page? Is it the file from the downloader at sciactive.com?

farshidrezaei commented 7 years ago

i have same issue. please heeeelp

farshidrezaei commented 7 years ago

I craete a trick for it.

just add this :

<script>
   $(document).ready(function (){
           $('.ui-pnotify').remove();
   });
</script>
kunleawotunbo commented 7 years ago

I was able to remove the annoying Welcome notification by commenting out init_PNotify() in the custom.min.js

If you can't find the custom.min.js file, try and search for the content of the welcome notification in your directory. "Welcome. Try hovering over me. " there, you will see the init_PNotify() method.

I hope it solves it

hperrin commented 7 years ago

This code shouldn't be in the release. It should only exist on the demo page. Are you including code from a downloaded bundle or from NPM?

r21gh commented 6 years ago

@farshidrezaei solution will convert right Property to zero. As @kunleawotunbo mentioned this is the part of code that creates initial message.

          function init_PNotify() {
        if( typeof (PNotify) === 'undefined'){ return; }
        console.log('init_PNotify');

        new PNotify({
          title: "PNotify",
          type: "info",
          text: "Welcome. Try hovering over me. You can click things behind me, because I'm non-blocking.",
          nonblock: {
              nonblock: true
          },
          addclass: 'dark',
          styling: 'bootstrap3',
          hide: false,
          before_close: function(PNotify) {
            PNotify.update({
              title: PNotify.options.title + " - Enjoy your Stay",
              before_close: null
            });

            PNotify.queueRemove();

            return false;
          }
        });

    };

In order to remove the message, I think it's better to delete init_PNotify() from custom.min.js

farshidrezaei commented 6 years ago

@RezaGhanbari hi. but this section code dose not exist in mycustom.min.js.
i first search for that. but after not finding it, i used the solution that i mentioned above.

themaoci commented 6 years ago

i found a consensus solution. public_html/layouts/resources/helper.js

after this: Vtiger_Helper_Js.showPnotify(params); add: Vtiger_Helper_Js.hidePnotify(); lines at work: 170-171

ps how it works in yeti ? after u slide ur mouse over popup its disapear xD

MuhammadAhmadMir commented 6 years ago

You just need to see the last function of custom.js. There you will find a $(document).ready() function. Just remove _init_PNotify()_ from it.

hperrin commented 6 years ago

It looks like what you guys were seeing was because index.html was listed in Bower before. It is not included anymore, so it should work if you update PNotify in Bower. v4 will not support Bower, btw, so to stay current, you'll have to either move away from Bower, or fork PNotify and commit the generated JS files.

hperrin commented 6 years ago

Either that or gremlins.

rramalho commented 5 years ago

webpack.mix... was always copying the files on my code. it was erasing the modifications before combine

derlypacheco commented 5 years ago

tengo el mismo problema y no encuentro como removelo por consola uso el remove PNotify.removeAll(); y funciona pero lo dejo en el codigo y no lo remueve

ghost commented 5 years ago

Find custom.min.js file, at the bottom of it you will see a bunch of codes like

....init_chart_doughnut(),init_gauge(),init_PNotify(),init_starrr(),init_calendar().....

delete init_PNotify() from there. This solves the problem.

jordisalord commented 5 years ago

Hola, buenas noches,

Yo también tenía el mismo problema y lo acabo de solucionar, primero noté que cuando abría la consola de desarrollador de chrome aparecía un mensaje init_PNotify. Empecé a buscar de donde aparecía este mensaje y provenía de un archivo en mi caso llamado "custom.min.js", que iniciaba una función llamada init_PNotify y lo que hace es crear esa molesta notificación, entonces elimine la función y con eso logré eliminar la notificación. Espero sea de tu ayuda Saludos

English version (Google translate) :) Hi, first sorry for my english. I also had the same problem and I just solved it, first I noticed that when I opened the chrome developer console I was shown an init_PNotify message. I started looking for where this message appeared and came from a file in my case called "custom.min.js", which started a function called init_PNotify and what it does is create that annoying notification, then delete the function and with that I managed to eliminate the notification. I hope it's your help. regards

It may come from "gentelella" bootstrap theme, "bower_components/gentelella/build/js/custom.min.js".

Thanks!

JuinEsp commented 2 years ago

Eu crio um truque para isso.

basta adicionar isso:

<script>
   $(document).ready(function (){
           $('.ui-pnotify').remove();
   });
</script>

Funcionou muito bem para mim.