quarks
quarks

Reputation: 35346

Using GwtQuery to handle JS events

I have this JSNI code that I want to basically migrate to use plain Java, i.e usign GwtQuery:

public static native void handleModalEvent(Element el)/*-{
    $wnd.$(el).on({
        'show.uk.modal': function(){
            $wnd.$("#new-placeholder").prepend($wnd.$(".g-r"));
        },
        'hide.uk.modal': function(){
            $wnd.$("#old-placeholder").prepend($wnd.$(".g-r"));
        }
    });
}-*/;

However I have tried to use the GwtQuery on() method. It would not work at all. However this JSNI code works really well. Can anyone suggest the best GWT/GwtQuery based call for this method?

Upvotes: 0

Views: 69

Answers (1)

jdramaix
jdramaix

Reputation: 1104

I think gwtquery doesn't accept '.' In the name space. Try "show.uk_modal" and "hide.uk_modal" it should work.

Upvotes: 1

Related Questions