| 1 | <!DOCTYPE html> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <meta http-equiv="Content-type" content="text/html; charset=utf-8"> |
| 5 | <title>Dialog Widget Dojo Tests</title> |
| 6 | |
| 7 | <script type="text/javascript" src="boilerplate.js"></script> |
| 8 | |
| 9 | <style type="text/css"> |
| 10 | body { font-family : sans-serif; } |
| 11 | form { margin-bottom : 0; } |
| 12 | table { border: none; } |
| 13 | #dialog3_underlay { background-color: #027 } |
| 14 | </style> |
| 15 | |
| 16 | |
| 17 | <script type="text/javascript"> |
| 18 | require(["dojo/parser", "dijit/Dialog", "dijit/form/Button", "dojo/domReady!"], function(parser, Dialog, Button){ |
| 19 | |
| 20 | createAndShow = function(){ |
| 21 | var node = document.createElement("div"); |
| 22 | document.body.appendChild(node); |
| 23 | var dlg = new Dialog({ title: "test input focus" }, node); |
| 24 | |
| 25 | var input = document.createElement("input"); |
| 26 | input.tabIndex = 0; |
| 27 | dlg.containerNode.appendChild(input); |
| 28 | |
| 29 | var btn = new Button({ |
| 30 | id: "destroyButton", |
| 31 | label: "Close", |
| 32 | onClick: function(){ |
| 33 | console.log("destroying, while visible"); |
| 34 | dlg.destroy(); |
| 35 | } |
| 36 | }); |
| 37 | dlg.containerNode.appendChild(btn.domNode); |
| 38 | |
| 39 | dlg.show(); |
| 40 | }; |
| 41 | |
| 42 | parser.parse(); |
| 43 | |
| 44 | }); |
| 45 | </script> |
| 46 | </head> |
| 47 | <body class="claro" role="main"> |
| 48 | |
| 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 | <label for="testInput">testInput:</label><input id="testInput" name="foo" value="bar" /> |
| 56 | |
| 57 | <button id="showDialog" data-dojo-type="dijit/form/Button" data-dojo-props='onClick:function(){ createAndShow() }'>Show Dialog</button> |
| 58 | |
| 59 | </body> |
| 60 | </html> |