1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
--- query.menu.js 2012-03-17 21:13:29.000000000 +0100
+++ JsMenu.java 2012-03-17 21:04:09.000000000 +0100
@@ -114,7 +113,7 @@
this.openTimer = null;
this.init();
- if ( items && items.constructor == Array )
+ if ( items && $.isArray(items) )
this.addItems(items);
}
});
@@ -132,11 +129,15 @@
while ( t.parentNode && t.parentNode != $rootDiv[0] )
t = t.parentNode;
- //is the found node one of the visible menu elements?
- if ( !$(visibleMenus).filter(function(){ return this.$eDIV[0] == t }).length )
- {
- $.Menu.closeAll();
- }
+ // FIXME: why do we need a timeout
+ setTimeout($.Menu.closeAll, 100);
+
+ // FIXME: JsQuery each doesn't work with arrays
+ // if ( !$(visibleMenus).filter(function(){ return this.$eDIV[0] == t }).length )
+ // {
+ // $.Menu.closeAll();
+ // }
+ return true;
},
checkKey : function(e)
{
@@ -395,7 +394,7 @@
this.$eDIV.css({display:'none', visibility: ''}).show();
//IEs default width: auto is bad! ie6 and ie7 have are producing different errors.. (7 = 5px shadowbox + 2px border)
- if ( $.browser.msie )
+ if ( 0) //$.browser.msie )
this.$eUL.css('width', parseInt($.browser.version) == 6 ? this.$eDIV.width() - 7 : this.$eUL.width());
if ( this.settings.onOpen )
@@ -437,7 +438,7 @@
}
//y-pos
- if ( $.fn.scrollTop )
+ if ($().scrollTop )
{
wst = $(window).scrollTop();
if ( wh < height ) //menu is bigger than the window
@@ -476,7 +477,7 @@
}
}
//x-pos
- if ( $.fn.scrollLeft )
+ if ($().scrollLeft )
{
wsl = $(window).scrollLeft();
if ( ww + wsl < posX + width )
@@ -898,7 +897,7 @@
{
return this.each(function()
{
- if ( items && items.constructor == Array )
+ if ( items && $.isArray(items) )
new $.Menu(this, items, options);
else
{
|