From c8beedfe35a6a558c086634fc063f9c64fa88d03 Mon Sep 17 00:00:00 2001 From: Manolo Carrasco Date: Thu, 15 Mar 2012 10:21:58 +0000 Subject: [PATCH] method afterCreate calls the onload functions --- .../src/main/java/gwtquery/jsquery/client/JsMenu.java | 3 ++- .../main/java/gwtquery/jsquery/client/JsQuery.java | 11 +---------- .../java/gwtquery/jsquery/client/OverlayGQuery.java | 6 ++++++ 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/jsquery/src/main/java/gwtquery/jsquery/client/JsMenu.java b/jsquery/src/main/java/gwtquery/jsquery/client/JsMenu.java index 1312cc55..57c3cbdd 100644 --- a/jsquery/src/main/java/gwtquery/jsquery/client/JsMenu.java +++ b/jsquery/src/main/java/gwtquery/jsquery/client/JsMenu.java @@ -4,9 +4,10 @@ public abstract class JsMenu { public static native void loadPlugin() /*-{ var l = @gwtquery.jsquery.client.utils.JsQueryUtils::log(Ljava/lang/Object;); + var jQuery = $wnd.$; + var $ = $wnd.$; var window = $wnd; var document = $doc; - var jQuery = $wnd.$; (function($) { diff --git a/jsquery/src/main/java/gwtquery/jsquery/client/JsQuery.java b/jsquery/src/main/java/gwtquery/jsquery/client/JsQuery.java index ad15715a..9514ae73 100644 --- a/jsquery/src/main/java/gwtquery/jsquery/client/JsQuery.java +++ b/jsquery/src/main/java/gwtquery/jsquery/client/JsQuery.java @@ -20,8 +20,7 @@ public class JsQuery implements EntryPoint { }); OverlayGQuery.export(); - JsMenu.loadPlugin(); - onJsQueryLoad(); +// JsMenu.loadPlugin(); // testJs(); } @@ -33,12 +32,4 @@ public class JsQuery implements EntryPoint { }); }-*/; - private native static void onJsQueryLoad() /*-{ - $ = $wnd.$; - window = $wnd; - document = $doc; - - $wnd.onJsQueryLoad && $wnd.onJsQueryLoad(); - $wnd.JsQuery && $wnd.JsQuery.onLoad && $wnd.JsQuery.onLoad(); - }-*/; } diff --git a/jsquery/src/main/java/gwtquery/jsquery/client/OverlayGQuery.java b/jsquery/src/main/java/gwtquery/jsquery/client/OverlayGQuery.java index 4708212f..59d70d4a 100644 --- a/jsquery/src/main/java/gwtquery/jsquery/client/OverlayGQuery.java +++ b/jsquery/src/main/java/gwtquery/jsquery/client/OverlayGQuery.java @@ -80,6 +80,12 @@ public class OverlayGQuery implements ExportOverlay { */ @ExportAfterCreateMethod public static native void afterCreate() /*-{ + $ = $wnd.$; + window = $wnd; + document = $doc; + + $wnd.onJsQueryLoad && $wnd.onJsQueryLoad(); + $wnd.JsQuery && $wnd.JsQuery.onLoad && $wnd.JsQuery.onLoad(); }-*/; @ExportStaticMethod("$wnd.$") -- 2.39.5