@@ -10,26 +10,26 @@ test("title id", function() {
10
10
expect ( 1 ) ;
11
11
12
12
var titleId ,
13
- el = $ ( "<div></div>" ) . dialog ( ) ;
13
+ element = $ ( "<div></div>" ) . dialog ( ) ;
14
14
15
- titleId = el . dialog ( "widget" ) . find ( ".ui-dialog-title" ) . attr ( "id" ) ;
15
+ titleId = element . dialog ( "widget" ) . find ( ".ui-dialog-title" ) . attr ( "id" ) ;
16
16
ok ( / u i - i d - \d + $ / . test ( titleId ) , "auto-numbered title id" ) ;
17
- el . remove ( ) ;
17
+ element . remove ( ) ;
18
18
} ) ;
19
19
20
20
test ( "ARIA" , function ( ) {
21
21
expect ( 4 ) ;
22
22
23
- var el = $ ( "<div></div>" ) . dialog ( ) ,
24
- wrapper = el . dialog ( "widget" ) ;
23
+ var element = $ ( "<div></div>" ) . dialog ( ) ,
24
+ wrapper = element . dialog ( "widget" ) ;
25
25
equal ( wrapper . attr ( "role" ) , "dialog" , "dialog role" ) ;
26
26
equal ( wrapper . attr ( "aria-labelledby" ) , wrapper . find ( ".ui-dialog-title" ) . attr ( "id" ) ) ;
27
- equal ( wrapper . attr ( "aria-describedby" ) , el . attr ( "id" ) , "aria-describedby added" ) ;
28
- el . remove ( ) ;
27
+ equal ( wrapper . attr ( "aria-describedby" ) , element . attr ( "id" ) , "aria-describedby added" ) ;
28
+ element . remove ( ) ;
29
29
30
- el = $ ( "<div><div aria-describedby='section2'><p id='section2'>descriotion</p></div></div>" ) . dialog ( ) ;
31
- strictEqual ( el . dialog ( "widget" ) . attr ( "aria-describedby" ) , undefined , "no aria-describedby added, as already present in markup" ) ;
32
- el . remove ( ) ;
30
+ element = $ ( "<div><div aria-describedby='section2'><p id='section2'>descriotion</p></div></div>" ) . dialog ( ) ;
31
+ strictEqual ( element . dialog ( "widget" ) . attr ( "aria-describedby" ) , undefined , "no aria-describedby added, as already present in markup" ) ;
32
+ element . remove ( ) ;
33
33
} ) ;
34
34
35
35
test ( "widget method" , function ( ) {
@@ -41,7 +41,7 @@ test("widget method", function() {
41
41
42
42
asyncTest ( "focus tabbable" , function ( ) {
43
43
expect ( 5 ) ;
44
- var el ,
44
+ var element ,
45
45
options = {
46
46
buttons : [ {
47
47
text : "Ok" ,
@@ -50,53 +50,53 @@ asyncTest( "focus tabbable", function() {
50
50
} ;
51
51
52
52
function checkFocus ( markup , options , testFn , next ) {
53
- el = $ ( markup ) . dialog ( options ) ;
53
+ element = $ ( markup ) . dialog ( options ) ;
54
54
setTimeout ( function ( ) {
55
55
testFn ( ) ;
56
- el . remove ( ) ;
56
+ element . remove ( ) ;
57
57
setTimeout ( next ) ;
58
58
} ) ;
59
59
}
60
60
61
61
function step1 ( ) {
62
62
checkFocus ( "<div><input><input autofocus></div>" , options , function ( ) {
63
- equal ( document . activeElement , el . find ( "input" ) [ 1 ] ,
63
+ equal ( document . activeElement , element . find ( "input" ) [ 1 ] ,
64
64
"1. first element inside the dialog matching [autofocus]" ) ;
65
65
} , step2 ) ;
66
66
}
67
67
68
68
function step2 ( ) {
69
69
checkFocus ( "<div><input><input></div>" , options , function ( ) {
70
- equal ( document . activeElement , el . find ( "input" ) [ 0 ] ,
70
+ equal ( document . activeElement , element . find ( "input" ) [ 0 ] ,
71
71
"2. tabbable element inside the content element" ) ;
72
72
} , step3 ) ;
73
73
}
74
74
75
75
function step3 ( ) {
76
76
checkFocus ( "<div>text</div>" , options , function ( ) {
77
77
equal ( document . activeElement ,
78
- el . dialog ( "widget" ) . find ( ".ui-dialog-buttonpane button" ) [ 0 ] ,
78
+ element . dialog ( "widget" ) . find ( ".ui-dialog-buttonpane button" ) [ 0 ] ,
79
79
"3. tabbable element inside the buttonpane" ) ;
80
80
} , step4 ) ;
81
81
}
82
82
83
83
function step4 ( ) {
84
84
checkFocus ( "<div>text</div>" , { } , function ( ) {
85
85
equal ( document . activeElement ,
86
- el . dialog ( "widget" ) . find ( ".ui-dialog-titlebar .ui-dialog-titlebar-close" ) [ 0 ] ,
86
+ element . dialog ( "widget" ) . find ( ".ui-dialog-titlebar .ui-dialog-titlebar-close" ) [ 0 ] ,
87
87
"4. the close button" ) ;
88
88
} , step5 ) ;
89
89
}
90
90
91
91
function step5 ( ) {
92
- el = $ ( "<div>text</div>" ) . dialog ( {
92
+ element = $ ( "<div>text</div>" ) . dialog ( {
93
93
autoOpen : false
94
94
} ) ;
95
- el . dialog ( "widget" ) . find ( ".ui-dialog-titlebar-close" ) . hide ( ) ;
96
- el . dialog ( "open" ) ;
95
+ element . dialog ( "widget" ) . find ( ".ui-dialog-titlebar-close" ) . hide ( ) ;
96
+ element . dialog ( "open" ) ;
97
97
setTimeout ( function ( ) {
98
- equal ( document . activeElement , el . parent ( ) [ 0 ] , "5. the dialog itself" ) ;
99
- el . remove ( ) ;
98
+ equal ( document . activeElement , element . parent ( ) [ 0 ] , "5. the dialog itself" ) ;
99
+ element . remove ( ) ;
100
100
start ( ) ;
101
101
} ) ;
102
102
}
@@ -119,9 +119,9 @@ test( "#7960: resizable handles below modal overlays", function() {
119
119
asyncTest ( "Prevent tabbing out of dialogs" , function ( ) {
120
120
expect ( 3 ) ;
121
121
122
- var el = $ ( "<div><input><input></div>" ) . dialog ( ) ,
123
- inputs = el . find ( "input" ) ,
124
- widget = el . dialog ( "widget" ) [ 0 ] ;
122
+ var element = $ ( "<div><input><input></div>" ) . dialog ( ) ,
123
+ inputs = element . find ( "input" ) ,
124
+ widget = element . dialog ( "widget" ) [ 0 ] ;
125
125
126
126
function checkTab ( ) {
127
127
ok ( $ . contains ( widget , document . activeElement ) , "Tab key event moved focus within the modal" ) ;
@@ -134,7 +134,7 @@ asyncTest( "Prevent tabbing out of dialogs", function() {
134
134
function checkShiftTab ( ) {
135
135
ok ( $ . contains ( widget , document . activeElement ) , "Shift-Tab key event moved focus within the modal" ) ;
136
136
137
- el . remove ( ) ;
137
+ element . remove ( ) ;
138
138
setTimeout ( start ) ;
139
139
}
140
140
0 commit comments