package gwtquery.jsquery.client;
+/**
+ *
+ * This class wraps the jquery menu plugin from:
+ *
+ * http://p.sohei.org/jquery-plugins/menu/
+ *
+ */
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($)
{
}
//y-pos
- if (0) //$.fn.scrollTop )
+ if ($().scrollTop )
{
wst = $(window).scrollTop();
if ( wh < height ) //menu is bigger than the window
}
}
//x-pos
- if (0) //$.fn.scrollLeft )
+ if ($().scrollLeft )
{
wsl = $(window).scrollLeft();
if ( ww + wsl < posX + width )
});
OverlayGQuery.export();
-// JsMenu.loadPlugin();
+ JsMenu.loadPlugin();
+ OverlayGQuery.onLoad();
+
// testJs();
}
GWT.create(OverlayGQuery.class);
}
+ @NoExport
+ public static native void onLoad() /*-{
+ $wnd.onJsQueryLoad && $wnd.onJsQueryLoad();
+ $wnd.JsQuery && $wnd.JsQuery.onLoad && $wnd.JsQuery.onLoad();
+ }-*/;
+
@ExportPackage("jsQuery")
@Export("jFunction")
@ExportClosure()
$ = $wnd.$;
window = $wnd;
document = $doc;
-
- $wnd.onJsQueryLoad && $wnd.onJsQueryLoad();
- $wnd.JsQuery && $wnd.JsQuery.onLoad && $wnd.JsQuery.onLoad();
}-*/;
@ExportStaticMethod("$wnd.$")
--- jquery.menu.js 2012-03-15 10:34:24.000000000 +0100
-+++ JsMenu.jsni 2012-03-15 10:36:20.000000000 +0100
-@@ -134,6 +113,14 @@
++++ JsMenu.java 2012-03-15 13:19:42.000000000 +0100
+@@ -134,6 +130,14 @@
t = t.parentNode;\r
\r
//is the found node one of the visible menu elements?\r
if ( !$(visibleMenus).filter(function(){ return this.$eDIV[0] == t }).length )\r
{\r
$.Menu.closeAll();\r
-@@ -239,9 +226,7 @@
+@@ -239,9 +243,7 @@
$.extend(defaults, d);\r
},\r
prototype : {\r
init : function()\r
{\r
var self = this;\r
-@@ -397,7 +382,7 @@
+@@ -397,7 +399,7 @@
this.$eDIV.css({display:'none', visibility: ''}).show();\r
\r
//IEs default width: auto is bad! ie6 and ie7 have are producing different errors.. (7 = 5px shadowbox + 2px border)\r
this.$eUL.css('width', parseInt($.browser.version) == 6 ? this.$eDIV.width() - 7 : this.$eUL.width());\r
\r
if ( this.settings.onOpen )\r
-@@ -439,7 +426,7 @@
+@@ -439,7 +443,7 @@
}\r
\r
//y-pos\r
- if ( $.fn.scrollTop )\r
-+ if (0) //$.fn.scrollTop )
++ if ($().scrollTop )
{\r
wst = $(window).scrollTop();\r
if ( wh < height ) //menu is bigger than the window\r
-@@ -478,7 +465,7 @@
+@@ -478,7 +482,7 @@
}\r
}\r
//x-pos\r
- if ( $.fn.scrollLeft )\r
-+ if (0) //$.fn.scrollLeft )
++ if ($().scrollLeft )
{\r
wsl = $(window).scrollLeft();\r
if ( ww + wsl < posX + width )\r
new JsUtils.JsFunction(jso).fe();
} else {
GQuery r = GQuery.$(jso);
- if (JsUtils.isArray(jso)) {
+ if (!JsUtils.isWindow(jso) && !JsUtils.isElement(jso) && JsUtils.isArray(jso)) {
JsCache c = jso.cast();
JsNodeArray elms = JsNodeArray.create();
for (int i = 0; i < c.length(); i++) {