]> git.pond.sub.org Git - eow/blob - static/dojo-release-1.1.1/dijit/tests/test_Dialog_focusDestroy.html
Comment class stub
[eow] / static / dojo-release-1.1.1 / dijit / tests / test_Dialog_focusDestroy.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2                 "http://www.w3.org/TR/html4/strict.dtd">
3 <html>
4 <head>
5         <title>Dialog Widget Dojo Tests</title>
6
7         <style type="text/css">
8                 @import "../../dojo/resources/dojo.css";
9                 @import "css/dijitTests.css";
10
11                 body { font-family : sans-serif; }
12                 form { margin-bottom : 0; }
13                 table { border: none; }
14                 #dialog3_underlay { background-color: #027 }
15         </style>
16
17         <script type="text/javascript"
18                 djConfig="parseOnLoad: true, isDebug: true"
19                 src="../../dojo/dojo.js"></script>
20         <script type="text/javascript" src="_testCommon.js"></script>
21
22         <script type="text/javascript">
23                 dojo.require("dijit.Dialog");
24                 dojo.require("dijit.form.Button");
25
26                 // make dojo.toJson() print dates correctly (this feels a bit dirty)
27                 function createAndShow() {
28                         var node = document.createElement("div");
29                         dojo.body().appendChild(node);
30                         var dlg = new dijit.Dialog({ title: "test input focus" }, node);
31
32                         var input = document.createElement("input");
33                         dojo.attr(input,"tabIndex","0");
34                         dlg.containerNode.appendChild(input);
35
36                         var btn = new dijit.form.Button({ label: "Close" });
37                         dlg.containerNode.appendChild(btn.domNode);
38
39                         dojo.connect(btn, "onClick", function(){
40                                 console.log("destroying, while visible"); 
41                                 dlg.destroy();
42                                 
43                         });
44                         dlg.show();
45                 }
46         </script>
47 </head>
48 <body>
49 <h1 class="testTitle">Dijit layout.Dialog tests</h1>
50
51 <p>If you input this box, you can type. You should be able to type and use backspace/etc
52 when you destroy the visible dialog. refs <a href="http://trac.dojotoolkit.org/ticket/5351">#5351</a>
53 </p>
54
55 <input id="testInput" name="foo" value="bar" />
56
57 <button dojoType="dijit.form.Button" onclick="createAndShow()">Show Dialog</button>
58
59 </body>
60 </html>
61