Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F4793127
jquery.foundation.navigation.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
jquery.foundation.navigation.js
View Options
;(
function
(
$
,
window
,
undefined
)
{
'use strict'
;
$
.
fn
.
foundationNavigation
=
function
(
options
)
{
var
lockNavBar
=
false
;
// Windows Phone, sadly, does not register touch events :(
if
(
Modernizr
.
touch
||
navigator
.
userAgent
.
match
(
/Windows Phone/i
))
{
$
(
document
).
on
(
'click.fndtn touchstart.fndtn'
,
'.nav-bar a.flyout-toggle'
,
function
(
e
)
{
e
.
preventDefault
();
var
flyout
=
$
(
this
).
siblings
(
'.flyout'
).
first
();
if
(
lockNavBar
===
false
)
{
$
(
'.nav-bar .flyout'
).
not
(
flyout
).
slideUp
(
500
);
flyout
.
slideToggle
(
500
,
function
()
{
lockNavBar
=
false
;
});
}
lockNavBar
=
true
;
});
$
(
'.nav-bar>li.has-flyout'
,
this
).
addClass
(
'is-touch'
);
}
else
{
$
(
'.nav-bar>li.has-flyout'
,
this
).
on
(
'mouseenter mouseleave'
,
function
(
e
)
{
if
(
e
.
type
==
'mouseenter'
)
{
$
(
'.nav-bar'
).
find
(
'.flyout'
).
hide
();
$
(
this
).
children
(
'.flyout'
).
show
();
}
if
(
e
.
type
==
'mouseleave'
)
{
var
flyout
=
$
(
this
).
children
(
'.flyout'
),
inputs
=
flyout
.
find
(
'input'
),
hasFocus
=
function
(
inputs
)
{
var
focus
;
if
(
inputs
.
length
>
0
)
{
inputs
.
each
(
function
()
{
if
(
$
(
this
).
is
(
":focus"
))
{
focus
=
true
;
}
});
return
focus
;
}
return
false
;
};
if
(
!
hasFocus
(
inputs
))
{
$
(
this
).
children
(
'.flyout'
).
hide
();
}
}
});
}
};
})(
jQuery
,
this
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Feb 28, 21:39 (1 d, 7 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2434734
Default Alt Text
jquery.foundation.navigation.js (1 KB)
Attached To
Mode
rTOOLS Nasqueron Tools
Attached
Detach File
Event Timeline
Log In to Comment