Changeset 12162
- Timestamp:
- 01/25/08 03:07:46 (12 months ago)
- Location:
- dijit/trunk
- Files:
-
- 1 added
- 5 modified
-
Dialog.js (modified) (3 diffs)
-
form/Button.js (modified) (2 diffs)
-
layout/ContentPane.js (modified) (1 diff)
-
tests/test_Dialog.html (modified) (4 diffs)
-
tests/test_TooltipDialog.html (added)
-
_base/popup.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dijit/trunk/Dialog.js
r12161 r12162 147 147 // Don't change this parameter from the default value. 148 148 // This ContentPane parameter doesn't make sense for Dialog, since Dialog 149 // is never a child of a layout Container, nor can you specify the size of149 // is never a child of a layout container, nor can you specify the size of 150 150 // Dialog in order to control the size of an inner widget. 151 151 doLayout: false, … … 157 157 dojo.body().appendChild(this.domNode); 158 158 this.inherited("postCreate",arguments); 159 this.domNode.style.visibility="hidden"; 159 this.domNode.style.visibility = "hidden"; 160 this.domNode.style.position = "absolute"; 161 this.domNode.style.top = "-9999px"; 160 162 this.connect(this, "onExecute", "hide"); 161 163 this.connect(this, "onCancel", "hide"); … … 378 380 title: "", 379 381 382 // doLayout: Boolean 383 // Don't change this parameter from the default value. 384 // This ContentPane parameter doesn't make sense for TooltipDialog, since TooltipDialog 385 // is never a child of a layout container, nor can you specify the size of 386 // TooltipDialog in order to control the size of an inner widget. 387 doLayout: false, 388 380 389 // _firstFocusItem: DomNode 381 390 // The pointer to the first focusable node in the dialog -
dijit/trunk/form/Button.js
r12044 r12162 138 138 delete this.dropDownContainer; 139 139 } 140 dojo.body().appendChild(this.dropDown.domNode); 141 this.dropDown.domNode.style.display="none"; 140 dijit.popup.prepare(this.dropDown.domNode); 142 141 143 142 this.inherited(arguments); … … 185 184 if(this.disabled || this.readOnly){ return; } 186 185 if(e.keyCode == dojo.keys.DOWN_ARROW){ 187 if(!this.dropDown || this.dropDown.domNode.style. display=="none"){186 if(!this.dropDown || this.dropDown.domNode.style.visibility=="hidden"){ 188 187 dojo.stopEvent(e); 189 188 this._toggleDropDown(); -
dijit/trunk/layout/ContentPane.js
r12161 r12162 178 178 if(this.doLayout != "false" && this.doLayout !== false){ 179 179 this._checkIfSingleChild(); 180 console.log("singlechild " , this._singleChild, " my content box is ", this._contentBox);181 180 if(this._singleChild && this._singleChild.resize){ 182 181 this._singleChild.startup(); -
dijit/trunk/tests/test_Dialog.html
r12161 r12162 88 88 </div> 89 89 90 <div dojoType="dijit.form.DropDownButton">91 <span>Show Tooltip Dialog</span>92 <div dojoType="dijit.TooltipDialog" id="tooltipDlg" title="Enter Login information"93 execute="alert('submitted w/args:\n' + dojo.toJson(arguments[0], true));">94 <table>95 <tr>96 <td><label for="user">User:</label></td>97 <td><input dojoType=dijit.form.TextBox type="text" name="user" id="user"></td>98 </tr>99 <tr>100 <td><label for="pwd">Password:</label></td>101 <td><input dojoType=dijit.form.TextBox type="password" name="pwd" id="pwd"></td>102 </tr>103 <tr>104 <td><label for="date2">Date:</label></td>105 <td><input dojoType=dijit.form.DateTextBox name="date" id="date2"></td>106 </tr>107 <tr>108 <td><label for="time2">Time:</label></td>109 <td><input dojoType=dijit.form.TimeTextBox name="time" id="time2"></td>110 </tr>111 <tr>112 <td><label for="combo">Pizza:</label></td>113 <td>114 <select dojoType=dijit.form.FilteringSelect name="combo" id="combo" hasDownArrow="true">115 <option value="cheese">cheese</option>116 <option value="pepperoni">pepperoni</option>117 <option value="sausage">sausage</option>118 </select>119 </td>120 </tr>121 <tr>122 <td colspan="2" align="center">123 <button dojoType=dijit.form.Button type="submit" name="submit">Order</button>124 </td>125 </tr>126 </table>127 <div style="width: 300px;">Note: This tooltip dialog has a bunch of nested drop downs for testing keyboard and click handling</div>128 </div>129 </div> |130 90 131 91 <button dojoType="dijit.form.Button" onclick="createDialog()" title="shows after 3 second delay, with blue background">Programatic Dialog (3 second delay)</button> | … … 191 151 <button dojoType="dijit.form.Button" onclick="dijit.byId('fifthDlg').show();">Test slow loading HREF Dialog</button> 192 152 193 <div dojoType="dijit.Dialog" id="fifthDlg" href="layout/getResponse.php?delay=3000&messId=3" title="From HREF (slow network emulated)"></div> 194 195 <div dojoType="dijit.form.DropDownButton"> 196 <span>Test slowloading HREF Tooltip Dialog</span> 197 <div dojoType="dijit.TooltipDialog" href="layout/getResponse.php?delay=500&messId=2" title="tooltip dialog with no focusable items"> 198 </div> 199 </div> | 153 <div dojoType="dijit.Dialog" id="fifthDlg" href="layout/getResponse.php?delay=3000&messId=3" title="From HREF (slow network simulated)"></div> 200 154 201 155 <p><b><i>(scroll down to see more links to click, for testing positioning / scroll handling)</i></b></p> … … 266 220 consectetuer dapibus eros. Aliquam nisl. 267 221 </p> 268 <div style="float:right;clear:right;" dojoType="dijit.form.DropDownButton">269 <span>dropdown at right</span>270 <div dojoType="dijit.TooltipDialog" id="dialogright">271 <div style="white-space:nowrap;">Aliquam vitae enim. Duis scelerisque metus auctor est venenatis</div>272 </div>273 </div>274 222 <p> 275 223 Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean … … 293 241 tortor pharetra congue. Suspendisse pulvinar. 294 242 </p> 295 296 <div dojoType="dijit.form.DropDownButton" title="Enter Login information2">297 <span>Show Tooltip Dialog pointing upwards, with links</span>298 <div dojoType="dijit.TooltipDialog" title="General Information Dialog">299 <p>Vestibulum convallis eros ac justo. Proin dolor. Etiam aliquam. Nam300 ornare elit vel augue. Suspendisse potenti. Etiam sed mauris eu neque301 nonummy mollis. <a href="http://www.lipsum.com/">Vestibulum</a> vel purus ac pede semper accumsan. Vivamus302 lobortis, sem vitae nonummy lacinia, nisl est gravida magna, non cursus303 est quam sed urna. Phasellus adipiscing justo in <a href="http://www.lipsum.com/">ipsum</a>. Duis sagittis304 dolor sit amet magna. Suspendisse suscipit, neque eu dictum auctor,305 nisi augue tincidunt arcu, non lacinia magna purus nec magna. Praesent306 pretium sollicitudin sapien. <a href="http://www.lipsum.com/">Suspendisse imperdiet</a>. Class aptent taciti307 sociosqu ad litora torquent per conubia nostra, per inceptos308 hymenaeos.309 </p>310 </div>311 </div>312 (will go up if there isn't enough space on the bottom of the screen)313 314 243 <p>Vestibulum convallis eros ac justo. Proin dolor. Etiam aliquam. Nam 315 244 ornare elit vel augue. Suspendisse potenti. Etiam sed mauris eu neque -
dijit/trunk/_base/popup.js
r11113 r12162 13 13 beginZIndex=1000, 14 14 idGen = 1; 15 16 this.prepare = function(/*DomNode*/ node){ 17 // summary: 18 // Prepares a node to be used as a popup 19 // 20 // description: 21 // Attaches node to document.body, and 22 // positions it off screen, but not display:none, so that 23 // the widget doesn't appear in the page flow and/or cause a blank 24 // area at the bottom of the viewport (making scrollbar longer), but 25 // initialization of contained widgets works correctly 26 27 dojo.body().appendChild(node); 28 var s = node.style; 29 if(s.display == "none"){ 30 s.display=""; 31 } 32 s.visibility = "hidden"; // not needed for hiding, but used as flag that node is off-screen 33 s.position = "absolute"; 34 s.top = "-9999px"; 35 }; 15 36 16 37 this.open = function(/*Object*/ args){ … … 64 85 dojo.body().appendChild(wrapper); 65 86 66 widget.domNode.style.display=""; 87 var s = widget.domNode.style; 88 s.display = ""; 89 s.visibility = ""; 90 s.position = ""; 67 91 wrapper.appendChild(widget.domNode); 68 92 … … 81 105 // Compute the closest ancestor popup that's *not* a child of another popup. 82 106 // Ex: For a TooltipDialog with a button that spawns a tree of menus, find the popup of the button. 83 function getTopPopup(){ 84 for(var pi=stack.length-1; pi > 0 && stack[pi].parent === stack[pi-1].widget; pi--); 107 var getTopPopup = function(){ 108 for(var pi=stack.length-1; pi > 0 && stack[pi].parent === stack[pi-1].widget; pi--){ 109 /* do nothing, just trying to get right value for pi */ 110 } 85 111 return stack[pi]; 86 112 } … … 148 174 // #2685: check if the widget still has a domNode so ContentPane can change its URL without getting an error 149 175 if(!widget||!widget.domNode){ return; } 150 dojo.style(widget.domNode, "display", "none"); 151 dojo.body().appendChild(widget.domNode); 176 177 this.prepare(widget.domNode); 178 152 179 iframe.destroy(); 153 180 dojo._destroyElement(wrapper); … … 176 203 iframe = dojo.doc.createElement(html); 177 204 }else{ 178 variframe = dojo.doc.createElement("iframe");205 iframe = dojo.doc.createElement("iframe"); 179 206 iframe.src = 'javascript:""'; 180 207 iframe.className = "dijitBackgroundIframe";