source: Dev/trunk/src/client/dojox/mobile/tests/test_View-container-visibility.html

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

Added Dojo 1.9.3 release.

File size: 2.1 KB
Line 
1<!doctype html>
2<html>
3<head>
4        <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
5        <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
6        <meta name="apple-mobile-web-app-capable" content="yes">
7        <title>View/container visibility test</title>
8
9        <script type="text/javascript" src="../deviceTheme.js"></script>
10        <script type="text/javascript" src="../../../dojo/dojo.js"      data-dojo-config="async: true"></script>
11
12        <script type="text/javascript">
13                require([
14                        "dijit/registry",
15                        "dojox/mobile/View",
16                        "dojox/mobile/Heading",
17                        "dojo/domReady!"
18                ], function(registry, View, Heading){
19
20                        var view1 = new View(null, "view1");
21                        var heading1 = new Heading({label: "View 1"});
22                        view1.addChild(heading1);
23
24                        var view2 = new View(null, "view2");
25                        var heading2 = new Heading({label: "View 2"});
26                        view2.addChild(heading2);
27
28                        setVisible = function(){
29                                var container = document.getElementById("container");
30                                container.style.visibility = "visible";
31                        };
32
33                        doTransition = function(from, to){
34                                registry.byId(from).performTransition(to,1,"slide");
35                        };
36
37                        view1.startup();
38                        view2.startup();
39                });
40        </script>
41</head>
42<body>
43<pre style="font-size: 0.6em">Test case #1
441) reload this page
452) click on [A]
46- View1 should be visible
47- "container is visible" should display above the view
483) click on [B]
49- view1 should transition to view2
504) click on [C]
51- view2 should transition back to view1
52Test case #2
531) reload this page
542) click on [B]
553) click on [A]
56- View2 should be visible
57- "container is visible" should display above the view
584) click on [C]
59- view2 should transition to view1
605) click on [B]
61- view1 should transition back to view2
62</pre>
63<input type="button" value="[A] make container visible" onclick="setVisible();">
64<input type="button" value="[B] transition: view1>view2" onclick="doTransition('view1','view2');">
65<input type="button" value="[C] transition: view2>view1" onclick="doTransition('view2','view1');">
66<div id="container" style="visibility:hidden;">container is visible
67        <div id="view1"></div>
68        <div id="view2"></div>
69</div>
70</body>
71</html>
Note: See TracBrowser for help on using the repository browser.