/
positioning4a.html
83 lines (74 loc) · 2.99 KB
/
positioning4a.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>combobox</title>
<style type='text/css'>
body {font-family: verdana; margin: 0px; padding: 0px;}
h5 {
/*width:400px;*/
}
.padding10 {
height:10px;
width:1px;
}
.padding25 {
height:25px;
width:1px;
}
.combobox {
margin:0 0 10px 0;
}
</style>
<link type="text/css" href="combobox.css" rel="stylesheet" />
</head>
<body>
<h3>4. Combobox positioning tests - Combobox appended to documentElement</h3>
<!-- 4. Combobox positioning tests - Combobox appended to documentElement:
4a Tests that if the element can be positioned without scrolling below target, the dropdown opens bellow the target with full height.
4b Tests that if the element can be positioned with scrolling greater than min height, the dropdown opens bellow with height equal the space available.
4c Tests if the space above is greater than the space below and dropdown fits in space above, the dropdown opens above with full height.
4d Tests if the space above is greater than the space below and dropdown doesnt fit in space above, the dropdown opens to fit space avaialble above.
4e Tests if the space above is less than the space below and the dropdown doesnt fit the space available the dropdown opens bellow to fit the space avaialble. -->
<!-- 4a Tests that if the element can be positioned without scrolling below target, the dropdown opens bellow the target with full height. -->
<h5>4a Tests that if the element can be positioned without scrolling below target, the dropdown opens bellow the target with full height.</h3>
<div id="combobox4a_log"></div>
<input id="combobox4a" class="combobox" type="text" name="name4a" />
<script type='text/javascript'
src='../../../steal/steal.js'>
</script>
<script type='text/javascript'>
steal("canui/form/combobox/select",
"canui/form/combobox/ajax",
"jquery/dom/fixture").then(function($){
/*
* Utility functions.
*/
var createItems = function(n){
var data = [];
for (var i = 0; i < n; i++) {
data.push({
value: i,
text: "item" + i
})
}
data[0].selected = true;
return data;
}
// maximize window so that positioning tests execute correctly.
function maximize() {
window.moveTo(0, 0);
//window.resizeTo(screen.width, screen.height);
window.resizeTo("1366", "768");
}
maximize();
/*
* 4a Tests that if the element can be positioned without scrolling below target, the dropdown opens bellow the target with full height.
*/
$("#combobox4a").can_ui_form_combobox({
items: createItems(6)
});
});
</script>
</body>
</html>