Subversion Repositories Applications.papyrus

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2150 mathias 1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2
		"http://www.w3.org/TR/html4/strict.dtd">
3
<html>
4
<head>
5
 
6
	<title>Container</title>
7
 
8
	<script type="text/javascript" src="../../dojo/dojo.js" djConfig="isDebug: true, parseOnLoad: true"></script>
9
	<script type="text/javascript">
10
		dojo.require("doh.runner");
11
		dojo.require("dijit._Widget");
12
		dojo.require("dijit._Container");
13
 
14
		dojo.declare("dijit.TestContainer",
15
			[dijit._Widget, dijit._Container], { }
16
		);
17
 
18
		dojo.require("dojo.parser");
19
 
20
		dojo.addOnLoad(function(){
21
			doh.register("t",
22
				[
23
					{
24
						name: "getChildren",
25
						runTest: function(t){
26
							var c = dijit.byId("container");
27
							var children = c.getChildren();
28
							t.is(3, children.length);
29
							t.is("zero", children[0].id);
30
							t.is("one", children[1].id);
31
							t.is("two", children[2].id);
32
						}
33
					},
34
					{
35
						name: "_getSiblingOfChild",
36
						runTest: function(t){
37
							var c = dijit.byId("container");
38
							var children = c.getChildren();
39
							t.is("one", c._getSiblingOfChild(children[0], 1).id);
40
							t.is("two", c._getSiblingOfChild(children[1], 1).id);
41
							t.is(null, c._getSiblingOfChild(children[2], 1));
42
							t.is(null, c._getSiblingOfChild(children[0], -1));
43
							t.is("zero", c._getSiblingOfChild(children[1], -1).id);
44
							t.is("one", c._getSiblingOfChild(children[2], -1).id);
45
						}
46
					}
47
				]
48
			);
49
			doh.run();
50
		});
51
 
52
	</script>
53
</head>
54
<body class="tundra">
55
 
56
	<div id="container" dojoType="dijit.TestContainer">
57
		<div id="zero" dojoType="dijit._Widget"></div>
58
		<div id="one" dojoType="dijit._Widget"></div>
59
		<div id="two" dojoType="dijit._Widget"></div>
60
	</div>
61
 
62
</body>
63
</html>