[Dojo-checkins] bill - r3652 - in trunk: demos/widget demos/widget/Mail src src/widget src/widget/html

dojo-checkins-admin at dojotoolkit.org dojo-checkins-admin at dojotoolkit.org
Sun Apr 23 23:50:05 MDT 2006


Author: bill
Date: Sun Apr 23 23:50:04 2006
New Revision: 3652

Modified:
   trunk/demos/widget/Mail.html
   trunk/demos/widget/Mail/mail.css
   trunk/src/layout.js
   trunk/src/widget/FloatingPane.js
   trunk/src/widget/html/Button2.js
Log:
various layout related fixes to get options dialog to work in mail demo

Modified: trunk/demos/widget/Mail.html
==============================================================================
--- trunk/demos/widget/Mail.html	(original)
+++ trunk/demos/widget/Mail.html	Sun Apr 23 23:50:04 2006
@@ -98,9 +98,8 @@
 <div id="options" dojoType="FloatingPane" title="Options"
 	style="width: 300px; height: 200px; left: 300px; top: 300px; display: none;"
 	hasShadow="true" resizable="true">
-	<div dojoType="LayoutContainer" style="width: 100%; height: 100%">
-	  <div dojoType="TabContainer" layoutAlign="client">
-	  	<div dojoType="ContentPane" label="Sending/Receiving">
+	<div dojoType="TabContainer" layoutAlign="client">
+		<div dojoType="ContentPane" label="Sending/Receiving">
 	  		Transport type
 	  		<select>
 	  			<option>POP3</option>
@@ -108,14 +107,14 @@
 	  		</select>
 	  		<br>
 	  		Server: <input type="text"></input>
-	  	</div>
-	  	<div dojoType="ContentPane" label="Composition">
+		</div>
+		<div dojoType="ContentPane" label="Composition">
 			<input type="checkbox" name="cb1" id="cb1" dojoType="Checkbox" /> <label for="cb1">hello world</label><br />
 			<input type="checkbox" name="cb2" id="cb2" dojoType="Checkbox" /> <label for="cb2">foo bar baz</label><br />
 			<input type="checkbox" name="cb3" id="cb3" dojoType="Checkbox" /> <label for="cb3">woo yay hoopla</label><br /> 	
-	  	</div>
-	  </div>
-	  <div dojoType="ContentPane" layoutAlign="bottom" style="height: 25px; padding-top: 5px;">
+		</div>
+	</div>
+	<div dojoType="ContentPane" layoutAlign="bottom" style="height: 25px; padding-top: 5px;">
 	  	<div class="box">
 			<button dojoType="Button2" onclick="dojo.widget.byId('options').hide();">
 				<img src="Mail/cancel.gif" height=18>
@@ -125,9 +124,7 @@
 				<img src="Mail/ok.gif" height=18>
 				OK
 			</button>
-			<div style="clear: both;"></div>
 		</div>
-	  </div>
 	</div>
 </div>
 

Modified: trunk/demos/widget/Mail/mail.css
==============================================================================
--- trunk/demos/widget/Mail/mail.css	(original)
+++ trunk/demos/widget/Mail/mail.css	Sun Apr 23 23:50:04 2006
@@ -53,3 +53,7 @@
 
 .dojoButton .dojoButtonContents {
 }
+
+.dojoTabPaneWrapper {
+	padding: 8px 8px 8px 8px;
+}

Modified: trunk/src/layout.js
==============================================================================
--- trunk/src/layout.js	(original)
+++ trunk/src/layout.js	Sun Apr 23 23:50:04 2006
@@ -57,10 +57,7 @@
 			left = f.left+"px";
 			top = f.top+"px";
 		}
-		var classStr = "dojoAlign" + dojo.string.capitalize(pos);
-		if (!dojo.html.hasClass(elm, classStr)) {
-			dojo.html.prependClass(elm, classStr);
-		}
+		dojo.html.addClass(elm, "dojoAlign" + dojo.string.capitalize(pos));
 
 		// set size && adjust record of remaining space.
 		// note that setting the width of a <div> may affect it's height.
@@ -98,9 +95,10 @@
 };
 
 // This is essential CSS to make layout work (it isn't "styling" CSS)
+// make sure that the position:absolute in dojoAlign* overrides other classes
 dojo.style.insertCssText(
 	".dojoLayoutContainer{ position: relative; display: block; }\n" +
-	".dojoAlignTop, .dojoAlignBottom, .dojoAlignLeft, .dojoAlignRight { position: absolute; overflow: hidden; }\n" +
-	".dojoAlignClient, .dojoAlignFloat { position: absolute; overflow: auto; }\n"
+	"body .dojoAlignTop, body .dojoAlignBottom, body .dojoAlignLeft, body .dojoAlignRight { position: absolute; overflow: hidden; }\n" +
+	"body .dojoAlignClient, body .dojoAlignFloat { position: absolute; overflow: auto; }\n"
 );
 

Modified: trunk/src/widget/FloatingPane.js
==============================================================================
--- trunk/src/widget/FloatingPane.js	(original)
+++ trunk/src/widget/FloatingPane.js	Sun Apr 23 23:50:04 2006
@@ -56,6 +56,11 @@
 		// necessary for safari, khtml (for computing width/height)
 		document.body.appendChild(this.domNode);
 
+		// if display:none then state=minimized, otherwise state=normal
+		if(!this.isShowing()){
+			this.windowState="minimized";
+		}
+
 		// <img src=""> can hang IE!  better get rid of it
 		if(this.iconSrc==""){
 			dojo.dom.removeNode(this.titleBarIcon);
@@ -255,10 +260,11 @@
 			] );
 
 		// If any of the children have layoutAlign specified, obey it
-		dojo.layout(this.containerNode, this.children);
+		dojo.layout(this.containerNode, this.children, "top-bottom");
 		
 		this.bgIframe.onResized();
 		if(this.shadow){ this.shadow.size(w, h); }
+		this.onResized();
 	},
 
 	onParentResized: function() {

Modified: trunk/src/widget/html/Button2.js
==============================================================================
--- trunk/src/widget/html/Button2.js	(original)
+++ trunk/src/widget/html/Button2.js	Sun Apr 23 23:50:04 2006
@@ -110,6 +110,12 @@
 		} else {
 			menu.toggle();
 		}
+	},
+	
+	onParentResized: function(){
+		// Not sure why this is necessary; but if button is inside a hidden floating
+		// pane (see Mail.html demo).  Revisit when buttons are redesigned
+		this.sizeMyself();
 	}
 });
 


More information about the Dojo-checkins mailing list