summaryrefslogtreecommitdiffstatshomepage
path: root/includes/js/dijit/tests/layout/test_BorderContainer.html
blob: 29fae016e47b38ffd967e0cd53f6c511ae2fa8e9 (plain)
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>dijit.layout.BorderContainer Test</title>

	<style type="text/css">
		@import "../../../dojo/resources/dojo.css";
		@import "../css/dijitTests.css";

		.dijitContentPane:focus { color: cyan; font-weight: bold }
		body { margin-left: 20px }

		#mondrian .dijitSplitter { border: 0; background: black !important }
		#mondrian .dijitSplitterH { height: 10px }
		#mondrian .dijitSplitterV { width: 10px }
		#mondrian .dijitSplitterThumb { display: none }
		#mondrian .dijitSplitterActive { background-color: blue }
		#mondrian SPAN { display: none }
		#mondrian:hover SPAN { display: inline }
	</style>
	
	<script type="text/javascript" src="../../../dojo/dojo.js"
		djConfig="isDebug: true, parseOnLoad: true"></script>
	<script type="text/javascript" src="../_testCommon.js"></script>

	<script type="text/javascript">
		dojo.require("dijit.layout.BorderContainer");
		dojo.require("dijit.layout.ContentPane");
		dojo.require("dijit.form.FilteringSelect");

		function togglePanel(button, id){
			var leftPanel = dijit.byId(id);
			if(leftPanel){
				dijit.byId('border1').removeChild(leftPanel);
				leftPanel.destroy();
				button.innerHTML='Add left panel';
			}else{
				var container = dijit.byId('border1');
				var div = dojo.doc.createElement('div');
				div.innerHTML='left';
				container.domNode.appendChild(div);
				leftPanel = new dijit.layout.ContentPane({id: id, region:'left', style:'background-color: #acb386; width:100px', splitter:true, minSize:50, maxSize:150}, div);
				dijit.byId('border1').addChild(leftPanel);
				button.innerHTML='Remove left panel';
			}
		}
	</script>
</head>
<body>

	<h2 class="testTitle">dijit.layout.BorderContainer tests</h2>
	<p>Headline layout (default), left is constrained - min:50, max:150</p>

	<div id="border1" dojoType="dijit.layout.BorderContainer"
		style="border: 2px solid black; width: 90%; height: 300px; padding: 10px;">
		<div dojoType="dijit.layout.ContentPane" region="top" style="background-color: #b39b86; border: 15px black solid; height: 100px;" splitter="true">
			top bar
		</div>
		<div id="border1-left" dojoType="dijit.layout.ContentPane" region="left" style="background-color: #acb386; border: 10px green solid; width: 100px;" splitter="true" minSize="50" maxSize="150">
			left
		</div>
		<div dojoType="dijit.layout.ContentPane" region="center" style="background-color: #f5ffbf; padding: 30px;">
			main panel with <a href="http://www.dojotoolkit.org/">a link</a>.<br />
			(to check we're copying children around properly).<br />
			<select dojoType="dijit.form.FilteringSelect">
				<option value="1">foo</option>
				<option value="2">bar</option>
				<option value="3">baz</option>
			</select>
			Here's some text that comes AFTER the combo box.
		</div>
		<div dojoType="dijit.layout.ContentPane" region="right" style="background-color: #acb386; width: 100px;">
			right
		</div>
		<div dojoType="dijit.layout.ContentPane" region="bottom" style="background-color: #b39b86; height: 100px;" splitter="true">
			bottom bar
		</div>
	</div>

	<button onClick="togglePanel(this, 'border1-left')">Remove left panel</button>
	<br />

	<p>Sidebar layout, BiDi sensitive, liveSplitters: false</p>

	<div dojoType="dijit.layout.BorderContainer" design="sidebar" liveSplitters="false"
		style="border: 20px solid black; width: 90%; height: 300px; padding: 10px;">
		<div dojoType="dijit.layout.ContentPane" region="leading" style="background-color: #acb386; width: 100px;">
			leading
		</div>
		<div dojoType="dijit.layout.ContentPane" region="top" style="background-color: #b39b86; height: 100px;">
			top bar
		</div>
		<div dojoType="dijit.layout.ContentPane" region="center" style="background-color: #f5ffbf; padding: 10px;">
			main panel with <a href="http://www.dojotoolkit.org/">a link</a>.<br />
			(to check we're copying children around properly).<br />
			<select dojoType="dijit.form.FilteringSelect">
				<option value="1">foo</option>
				<option value="2">bar</option>
				<option value="3">baz</option>
			</select>
			Here's some text that comes AFTER the combo box.
		</div>
		<div dojoType="dijit.layout.ContentPane" region="bottom" style="background-color: #b39b86; height: 100px;" splitter="true">
			bottom bar
		</div>
		<div dojoType="dijit.layout.ContentPane" region="trailing" style="background-color: #acb386; width: 100px;" splitter="true">
			trailing
		</div>
	</div>
	
	<br />
	<p>Vertical panels only with splitters</p>
	
	<div dojoType="dijit.layout.BorderContainer" design="sidebar"
		style="border: 2px solid black; width: 90%; height: 300px; padding: 10px;">
		<div dojoType="dijit.layout.ContentPane" region="top" style="background-color: #b39b86; height: 100px;" splitter="true">
			top bar
		</div>
		
		<div dojoType="dijit.layout.ContentPane" region="center" style="background-color: #f5ffbf; padding: 10px;">
			main panel with <a href="http://www.dojotoolkit.org/">a link</a>.<br />
			(to check we're copying children around properly).<br />
			<select dojoType="dijit.form.FilteringSelect">
				<option value="1">foo</option>
				<option value="2">bar</option>
				<option value="3">baz</option>
			</select>
			Here's some text that comes AFTER the combo box.
		</div>
		<div dojoType="dijit.layout.ContentPane" region="bottom" style="background-color: #b39b86; height: 100px;" splitter="true">
			bottom bar
		</div>
	</div>
	
	<br />
	<p>More fun with layouts</p>
	
	<div id="mondrian" dojoType="dijit.layout.BorderContainer" design="sidebar" persist="true" style="height: 300px; width: 400px">
		<div dojoType="dijit.layout.ContentPane" region="top" style="height: 100px" splitter="true">
			<div dojoType="dijit.layout.BorderContainer" persist="true" style="height: 100px; width: 100%">
				<div dojoType="dijit.layout.ContentPane" region="leading" style="width: 125px" splitter="true"><span>top a</span></div>
				<div dojoType="dijit.layout.ContentPane" region="center" style="background-color: yellow" splitter="true"><span>top b</span></div>
			</div>
		</div>
		<div dojoType="dijit.layout.ContentPane" region="bottom" style="height: 100px" splitter="true">
			<div dojoType="dijit.layout.BorderContainer" persist="true" style="height: 100px; width: 100%">
				<div dojoType="dijit.layout.ContentPane" region="top" style="height: 40px" splitter="true"><span>bottom c</span></div>
				<div dojoType="dijit.layout.ContentPane" region="center"><span>bottom d</span></div>
			</div>
		</div>
		<div dojoType="dijit.layout.ContentPane" region="leading" style="width: 100px" splitter="true">
			<div dojoType="dijit.layout.BorderContainer" persist="true" style="height: 300px; width: 100%">
				<div dojoType="dijit.layout.ContentPane" region="center"><span>leading e</span></div>
				<div dojoType="dijit.layout.ContentPane" region="bottom" style="height: 100px; background-color: red" splitter="true"><span>leading f</span></div>
			</div>
		</div>
		<div dojoType="dijit.layout.ContentPane" region="trailing" style="width: 100px" splitter="true"><span>trailing g</span></div>
	</div>

	<br />

</body>
</html>