source: Dev/trunk/src/client/dojox/layout/tests/test_ExpandoPane_code.html

Last change on this file was 483, checked in by hendrikvanantwerpen, 11 years ago

Added Dojo 1.9.3 release.

File size: 3.0 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2        "http://www.w3.org/TR/html4/strict.dtd">
3<html lang="en">
4<head>
5        <title>dojox.layout.ExpandoPane</title>
6
7        <!-- required: a default theme file -->
8        <link rel="stylesheet" id="themeStyles" href="../../../dijit/themes/tundra/tundra.css">
9        <!-- test file style rollup, you need resources/ExpandoPane.css exclusively -->
10        <link rel="stylesheet" href="_expando.css">     
11
12        <!-- required: dojo.js -->
13        <script type="text/javascript" src="../../../dojo/dojo.js" data-dojo-config="isDebug:true, parseOnLoad: true"></script>
14
15        <!-- do not use! only for testing dynamic themes -->
16        <script type="text/javascript" src="../../../dijit/tests/_testCommon.js"></script>
17
18        <script type="text/javascript">
19                dojo.require("dojox.layout.ExpandoPane");
20                dojo.require("dijit.form.Button");
21                dojo.require("dijit.layout.ContentPane");
22                dojo.require("dijit.layout.BorderContainer");
23               
24                var _clearPane = function(){
25                        var ch = dijit.byId("bc").getChildren();
26                        dojo.forEach(["pane0","pane1","pane2","pane3"],function(p){
27
28                                dojo.byId("hidden").appendChild(dojo.byId(p));
29                                var dij = dijit.getEnclosingWidget(p.parentNode);
30                                if(dij){
31                                        console.log(dij);
32                                        dijit.byId("bc").removeChild(dij);
33                                        dij.destroy();
34                                }
35
36                        });
37                };
38
39        </script>
40        <style type="text/css">
41                #hidden {
42                        position:absolute;
43                        top:-999px;
44                        left:-999px;
45                        overflow:hidden;
46                        width:500px;
47                        height:500px;
48                        visibility:hidden;
49                }
50                #pane0, #pane1, #pane2, #pane3 {
51                        width:100%;
52                        height:100%;
53                }
54                #pane1 { background:red; }
55                #pane2 { background:green; }
56                #pane3 { background:blue; }
57                #pane0 { background:yellow; }
58        </style>
59</head>
60<body class="tundra" role="main">
61                <div id="bc" style="width:100%; height:100%;" dojoType="dijit.layout.BorderContainer">
62                        <div region="center" style="height:65px; border-bottom:1px solid #666">
63                                <button data-dojo-type="dijit.form.Button" type="button" region="top">
64                                        Set 3-pane
65                                        <script type="dojo/method" data-dojo-event="onClick" data-dojo-args="evt">
66                                                _clearPane();
67                                                var bc = dijit.byId("bc");
68                                               
69                                        //      var cp = new dijit.layout.ContentPane({
70                                                var cp = new dojox.layout.ExpandoPane({
71                                                        region:"left",
72                                                        duration:125,
73                                                        style:"width:125px; height:100%",
74                                                        splitter:true
75                                                });
76                                                cp.domNode.appendChild(dojo.byId("pane1"));
77                                                cp.startup();
78                                                bc.addChild(cp);
79                                               
80                                                var cp2 = new dijit.layout.ContentPane({
81                                                        region:"right",
82                                                        style:"width:125px; height:100%",
83                                                        splitter:true
84                                                });
85                                                cp2.domNode.appendChild(dojo.byId("pane2"));
86                                                cp2.startup();
87                                                bc.addChild(cp2);
88                                               
89                                                var cp3 = new dijit.layout.ContentPane({
90                                                        region:"center"
91                                                       
92                                                });
93                                                cp3.domNode.appendChild(dojo.byId("pane0"));
94                                                cp3.startup();
95                                                bc.addChild(cp3);
96                                               
97                                                bc.layout();
98                                        </script>
99                                </button>
100                        </div>
101                       
102                </div>
103                <div id="hidden">
104                        <div id="pane0">pane 0 content</div>
105                        <div id="pane1">pane 1 content</div>
106                        <div id="pane2">pane 2 content</div>
107                        <div id="pane3">pane 3 content</div>
108                </div>
109</body>
110</html>
Note: See TracBrowser for help on using the repository browser.