File tree 2 files changed +45
-9
lines changed
vendor/assets/javascripts/foundation
2 files changed +45
-9
lines changed Original file line number Diff line number Diff line change @@ -61,11 +61,25 @@ <h4>Nav Bar</h4>
61
61
< a href ="# "> Nav Item 2</ a >
62
62
< a href ="# " class ="flyout-toggle "> < span > </ span > </ a >
63
63
< ul class ="flyout ">
64
- < li > < a href ="# "> Sub Nav Item 1</ a > </ li >
65
- < li > < a href ="# "> Sub Nav Item 2</ a > </ li >
66
- < li > < a href ="# "> Sub Nav 3</ a > </ li >
67
- < li > < a href ="# "> Sub Nav 4</ a > </ li >
68
- < li > < a href ="# "> Sub Nav Item 5</ a > </ li >
64
+ < li >
65
+ < form action ="# " method ="post ">
66
+ < fieldset class ="textbox ">
67
+ < label >
68
+ < span > Username or email</ span >
69
+ < input type ="text " name ="username " autocomplete ="on ">
70
+ </ label >
71
+ < label >
72
+ < span > Password</ span >
73
+ < input class ="js-password-field " type ="password " value ="" name ="password ">
74
+ </ label >
75
+ < label >
76
+ < input type ="checkbox " value ="1 " name ="remember_me ">
77
+ < span > Remember me</ span >
78
+ </ label >
79
+ < button type ="submit " class ="nice button " style ="margin-bottom: 10px; "> Sign in</ button >
80
+ </ fieldset >
81
+ </ form >
82
+ </ li >
69
83
</ ul >
70
84
</ li >
71
85
< li class ="has-flyout ">
Original file line number Diff line number Diff line change 19
19
} ) ;
20
20
$ ( '.nav-bar>li.has-flyout' , this ) . addClass ( 'is-touch' ) ;
21
21
} else {
22
- $ ( '.nav-bar>li.has-flyout' , this ) . hover ( function ( ) {
23
- $ ( this ) . children ( '.flyout' ) . show ( ) ;
24
- } , function ( ) {
25
- $ ( this ) . children ( '.flyout' ) . hide ( ) ;
22
+ $ ( '.nav-bar>li.has-flyout' , this ) . on ( 'mouseenter mouseleave' , function ( e ) {
23
+ if ( e . type == 'mouseenter' ) {
24
+ $ ( this ) . children ( '.flyout' ) . show ( ) ;
25
+ }
26
+
27
+ if ( e . type == 'mouseleave' ) {
28
+ var flyout = $ ( this ) . children ( '.flyout' ) ,
29
+ inputs = flyout . find ( 'input' ) ,
30
+ hasFocus = function ( inputs ) {
31
+ var focus ;
32
+ if ( inputs . length > 0 ) {
33
+ inputs . each ( function ( ) {
34
+ if ( $ ( this ) . is ( ":focus" ) ) {
35
+ focus = true ;
36
+ }
37
+ } ) ;
38
+ return focus ;
39
+ }
40
+
41
+ return false ;
42
+ } ;
43
+
44
+ if ( ! hasFocus ( inputs ) ) {
45
+ $ ( this ) . children ( '.flyout' ) . hide ( ) ;
46
+ }
47
+ }
26
48
} ) ;
27
49
}
28
50
You can’t perform that action at this time.
0 commit comments