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 |
---|
44 | 1) reload this page |
---|
45 | 2) click on [A] |
---|
46 | - View1 should be visible |
---|
47 | - "container is visible" should display above the view |
---|
48 | 3) click on [B] |
---|
49 | - view1 should transition to view2 |
---|
50 | 4) click on [C] |
---|
51 | - view2 should transition back to view1 |
---|
52 | Test case #2 |
---|
53 | 1) reload this page |
---|
54 | 2) click on [B] |
---|
55 | 3) click on [A] |
---|
56 | - View2 should be visible |
---|
57 | - "container is visible" should display above the view |
---|
58 | 4) click on [C] |
---|
59 | - view2 should transition to view1 |
---|
60 | 5) 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> |
---|