-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Selectmenu #866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Selectmenu #866
Changes from 1 commit
f2228b0
156d0fb
e299e9a
cea6844
b1a72e6
72c17f0
8c10c1e
b4d9eee
94f8514
682a321
e38feea
4a9e26c
1092551
ec5f2ae
41dfb09
c6a8d7e
31a38e9
8fbdd7c
eae21ff
b348d32
ddf7c27
360e885
4460376
ff957dd
c5a449d
c3f6bd9
ec6d88f
b30184d
7345e43
37a8047
d4ec5cb
8abe1d0
749c8fb
39532f0
5092d02
8f5f4b3
b19986a
001bd3d
c7e9906
44f9b8f
83f4249
06372cd
549b97e
dd272e7
b6e2467
c179902
daadc84
66156aa
fb87e1c
5e12c54
cca4e77
fc729a8
c59fbba
20d19db
8e1e956
99aa0ff
86f4c2f
e059376
b8cce0c
9cf0f21
b2d50f9
e7e73ce
7c1a9d9
a59b3c7
228a9b9
b6e1c86
684b55b
7725e4a
a9a6e3b
94b3a65
7ce8e05
12fe28f
0734314
967e2b7
daec559
2bb459f
4160978
b7ee7b2
d24e62b
8cbbf33
f86168b
dff9917
a2d3ef3
dec8399
0d4a8dc
e25cdd8
709f75b
4e68c52
36533a7
7328333
8a62210
b014bc6
080b5bc
71e744a
e581a13
a177a92
1e6808a
ac7b8f9
f622428
18ecaf4
d1c9837
6fd9d8f
0d28263
04553a7
cba09da
60e3302
40b8567
aa60a9e
e6aca63
7a05c65
15032d1
2845d38
d1350f9
f6372bd
0732835
20aad07
812a90f
b15ae2a
ed422bd
8901960
c69d01b
1ea2256
21e46b8
e2b5123
25023c3
8aa24dd
57ecee8
930e9d5
ae68ab8
58f2706
1b1dbd8
76f335e
1afede8
52fc8e3
2ab514f
a787d52
8462194
50d7a96
dab7bf8
44e472a
2eb9223
1ba02e9
c960285
f244108
fb47fd0
dcb28a7
4d77ca3
f5e65b0
de149c4
91dde04
3a17a91
9719719
110cab1
b81bb0b
a7b4f29
78f9362
fdf3af6
75cfcf2
640d308
8a5e869
06eb3bf
50bb89f
f434271
d599bf9
d94e217
dffe8f6
8787cb0
890881d
f08b0af
f128292
6e80a19
022079a
8fc08a1
66ba390
6acc6bd
0bf91a4
a7ea386
775b81b
2f7bd63
a6e2863
e2235bd
5a9a80f
1ce8d87
ba0e804
26c528a
73c7342
4efd006
e1590c4
c0fa69d
026f517
4d986a4
c73f7e8
8b6c81e
1fa8c20
f2bd236
1cca829
0d7b25d
d66528b
c1667ba
ad30163
0264f07
60eed79
a29cfb8
68c7485
b84cd7e
8b4a304
00ab497
5e9ad9b
0631d76
ee9c443
17b6ff7
d4f13bc
666927b
b8339eb
4c930fd
70a4360
61be0e5
f96ee5e
6640925
7715c71
255d4f6
5e06985
adcfa63
ef8c792
1c878ce
97cca1e
ddf1347
cb5f9bb
83e795f
7e0737e
cccb8c6
29f726c
a572f72
dfbd712
84ee9d8
e7d200f
7be7d96
bfd3c4a
57fa482
33317c9
1821517
ab48ae7
ffc7d31
ab72fd1
9992d46
b735152
2c9f5a8
ff1bb14
3483b94
b9fa8f7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,15 +37,18 @@ <h2 id="qunit-banner"></h2> | |
<h2 id="qunit-userAgent"></h2> | ||
<ol id="qunit-tests"></ol> | ||
<div id="qunit-fixture"> | ||
<div id="sm-wrap1" class="sm-wrap"></div> | ||
|
||
<label for="speed">Select a speed:</label> | ||
<select name="speed" id="speed"> | ||
<option value="Slower">Slower</option> | ||
<option value="Slow">Slow</option> | ||
<option value="Medium" selected="selected">Medium</option> | ||
<option value="Fast">Fast</option> | ||
<option value="Faster">Faster</option> | ||
</select> | ||
<div id="sm-wrap2" class="sm-wrap"> | ||
<label for="speed">Select a speed:</label> | ||
<select name="speed" id="speed"> | ||
<option value="Slower">Slower</option> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we explicitly specifying a value here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We want to test the value returned by the selectmenu instance. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, the value and the label are the same for all the options. Is there a reason not to leave out the value and let the implicit value get used? This doesn't need to be changed, so it's certainly not wrong. It was just something that stood out as I was going through. |
||
<option value="Slow">Slow</option> | ||
<option value="Medium" selected="selected">Medium</option> | ||
<option value="Fast">Fast</option> | ||
<option value="Faster">Faster</option> | ||
</select> | ||
</div> | ||
|
||
<label for="number">Select a number:</label> | ||
<select name="number" id="number"> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,12 +3,45 @@ | |
module("selectmenu: options"); | ||
|
||
test("appendTo another element", function () { | ||
expect(2); | ||
expect( 8 ); | ||
|
||
var detached = $( "<div>" ), | ||
element = $("#speed").selectmenu(); | ||
equal( element.selectmenu( "menuWidget" ).parent().parent()[0], document.body, "defaults to body" ); | ||
element.selectmenu( "destroy" ); | ||
|
||
element.selectmenu({ | ||
appendTo: ".sm-wrap" | ||
}); | ||
equal( element.selectmenu( "menuWidget" ).parent().parent()[0], $( "#sm-wrap1" )[0], "first found element" ); | ||
equal( $( "#sm-wrap2 .ui-selectmenu" ).length, 0, "only appends to one element" ); | ||
element.selectmenu( "destroy" ); | ||
|
||
$( "#sm-wrap2" ).addClass( "ui-front" ); | ||
element.selectmenu(); | ||
equal( element.selectmenu( "menuWidget" ).parent().parent()[0], $( "#sm-wrap2" )[0], "null, inside .ui-front" ); | ||
element.selectmenu( "destroy" ); | ||
$( "#sm-wrap2" ).removeClass( "ui-front" ); | ||
|
||
element.selectmenu().selectmenu( "option", "appendTo", "#sm-wrap1" ); | ||
equal( element.selectmenu( "menuWidget" ).parent().parent()[0], $( "#sm-wrap1" )[0], "modified after init" ); | ||
element.selectmenu( "destroy" ); | ||
|
||
element.selectmenu({ | ||
appendTo: detached | ||
}); | ||
equal( element.selectmenu( "menuWidget" ).parent().parent()[0], detached[0], "detached jQuery object" ); | ||
element.selectmenu( "destroy" ); | ||
|
||
var element = $("#speed").selectmenu(); | ||
element.selectmenu({ | ||
appendTo: detached[0] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. spacing: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done, but should [0] have spaces in every circumstances? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On Mon, Apr 29, 2013 at 3:48 PM, Felix Nagel notifications@github.comwrote:
Yes. There used to be an exception for array accesses, but it was removed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done! |
||
}); | ||
equal( element.selectmenu( "menuWidget" ).parent().parent()[0], detached[0], "detached DOM element" ); | ||
element.selectmenu( "destroy" ); | ||
|
||
ok(element.selectmenu("option", "appendTo", "#qunit-fixture"), "appendTo accepts selector"); | ||
ok($("#qunit-fixture").find(".ui-selectmenu-menu").length, "selectmenu appendedTo other element"); | ||
element.selectmenu().selectmenu( "option", "appendTo", detached ); | ||
equal( element.selectmenu( "menuWidget" ).parent().parent()[0], detached[0], "detached DOM element via option()" ); | ||
element.selectmenu( "destroy" ); | ||
}); | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either rename to
wrap1
orselectmenu-wrap1
. Don't abbreviate selectmenu to sm.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed. This should be adjusted in autocomplete test too.