Skip to content

Commit 3f45f5c

Browse files
committed
Improving visual testcase for position. Partial fix for #5284 - Position: Smarter collision detection
1 parent 61e0aea commit 3f45f5c

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

tests/visual/position/position.html

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,29 @@
1313
<script type="text/javascript" src="http://jqueryui.com/themeroller/themeswitchertool/"></script>
1414
<script type="text/javascript">
1515
$(function() {
16-
var ul = $("ul");
17-
$("input").each(function() {
18-
$(this).position({
19-
my: this.id.replace(/-/, " "),
20-
at: this.id.replace(/-/, " "),
21-
of: "#container",
22-
collision: "none"
16+
var inputs = $("input");
17+
$("ul").insertAfter(inputs);
18+
$(window).resize(function() {
19+
inputs.each(function() {
20+
$(this).position({
21+
my: this.id.replace(/-/, " "),
22+
at: this.id.replace(/-/, " "),
23+
of: "#container",
24+
collision: "none"
25+
});
26+
$(this).next().menu().position({
27+
my: "left top",
28+
at: "left bottom",
29+
of: this
30+
});
2331
});
24-
ul.clone().insertAfter(this).menu().position({
25-
my: "left top",
26-
at: "left bottom",
27-
of: this
28-
});
29-
});
30-
ul.remove();
32+
}).resize();
3133
});
3234
</script>
3335
<style>
3436
input, .ui-menu { position: absolute; }
3537
.ui-menu { width: 200px; }
36-
html, body { width: 100%; height: 100% }
38+
html, body { width: 99%; height: 99% }
3739
#container { width: 95%; height: 95%; border: 1px solid black; margin: auto; }
3840
</style>
3941
</head>

0 commit comments

Comments
 (0)