0

GwtQuery for a "click" event it also does trigger on hover (sometimes), why is that?

   $("html").bind("click", new com.google.gwt.query.client.Function() {
        @Override
        public boolean f(com.google.gwt.user.client.Event e) {
            $(".hopscotch-bubble").fadeOut(new com.google.gwt.query.client.Function() {
                @Override
                public void f() {
                    JSNIHelper.infoNotify("INFO", "Fade out method invoked.");
                }
            });
            return true;
        }
    });
quarks
  • 33,478
  • 73
  • 290
  • 513
  • Check that other parts of your code are ok, gwtquery bind only sets the event you specify. Could you post a test or code fragment which demonstrates the wrong behaviour?. I have tested this code and works as expected (had to change JSNIHelper by log) – Manolo Carrasco Moñino Mar 06 '14 at 14:37
  • I had to put this code fragment in a @Singleton class – quarks Mar 06 '14 at 17:06
  • Of course you should not add the same binding to the same element multiple times, because you will fire the handler many times. – Manolo Carrasco Moñino Mar 08 '14 at 09:26
  • This bind method is called during onStart() of the Hopscotch tour, so it could have been called many times. This is because this ".hopscotch-bubble" is only available when the tour bubble is shown; or is it safe to bind to class even its not actively there yet? – quarks Mar 08 '14 at 10:56
  • anyhow, during the onEnd() and onClose() of the tour, the $("html").unbind("click"); is called, so it that enough? – quarks Mar 08 '14 at 10:58

1 Answers1

0

You have asked this question two times in same context :)

Please check my answer. It will definitely solve your problem.

Community
  • 1
  • 1
Braj
  • 46,415
  • 5
  • 60
  • 76