incubator-xap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mtu...@apache.org
Subject svn commit: r477871 - in /incubator/xap/trunk/src/xap: bridges/dojo/WindowBridge.js widgets/dojo/Window.js
Date Tue, 21 Nov 2006 20:31:19 GMT
Author: mturyn
Date: Tue Nov 21 12:31:18 2006
New Revision: 477871

URL: http://svn.apache.org/viewvc?view=rev&rev=477871
Log:
http://issues.apache.org/jira/browse/XAP-133
The window, when minimised, acted as if the titlebar were trans- 
parent and it keeps displaying one child component after another;
now the container node is hid when the window is minimised.

Modified:
    incubator/xap/trunk/src/xap/bridges/dojo/WindowBridge.js
    incubator/xap/trunk/src/xap/widgets/dojo/Window.js

Modified: incubator/xap/trunk/src/xap/bridges/dojo/WindowBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/dojo/WindowBridge.js?view=diff&rev=477871&r1=477870&r2=477871
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/dojo/WindowBridge.js (original)
+++ incubator/xap/trunk/src/xap/bridges/dojo/WindowBridge.js Tue Nov 21 12:31:18 2006
@@ -68,11 +68,17 @@
 
 	dojo.event.connectBefore(peer.titleBar,"ondblclick",this,"toggleMaximized");
 
+
+//	dojo.event.connectBefore(peer.domNode,"onkeydown",this,"kd");
+
 	
 	// Set max xor min, if desired, as early as possible:
 	if( this.getElement().getAttribute(xap.xml.XmlTokens.MINIMIZED) == "true"){
 		this.setMinimizedAttribute(xap.xml.XmlTokens.TRUE) ;
 	} else if( this.getElement().getAttribute(xap.xml.XmlTokens.MAXIMIZED) == "true"){
+		if( this.getPeer().windowState == xap.xml.XmlTokens.MINIMIZED){
+			this.wasMaximisedFromMinimized = true ;
+		}	
 		this.setMaximizedAttribute(xap.xml.XmlTokens.TRUE) ;
 	} 
 	// (on start-up, set[Min|Max]imizedAttribute() gets
@@ -219,6 +225,9 @@
 /** XML attribute set method for "maximized" */
 xap.bridges.dojo.WindowBridge.prototype.setMaximizedAttribute = function(value){
 	if( value == xap.xml.XmlTokens.TRUE){
+		if( this.getPeer().windowState == xap.xml.XmlTokens.MINIMIZED){
+			this.wasMaximisedFromMinimized = true ;
+		}	
 		if (this.getElement().getAttribute(xap.xml.XmlTokens.MAXIMIZABLE)
 				!= xap.xml.XmlTokens.FALSE
 			){
@@ -249,9 +258,6 @@
 
 xap.bridges.dojo.WindowBridge.prototype.toggleMaximized = function(){
 	if (this.getPeer().windowState != xap.xml.XmlTokens.MAXIMIZED){
-		if( this.getPeer().windowState == xap.xml.XmlTokens.MINIMIZED){
-			this.wasMaximisedFromMinimized = true ;
-		}
 		this.setMaximizedAttribute( xap.xml.XmlTokens.TRUE ) ;
 		this.writeBackAttribute(xap.xml.XmlTokens.MINIMIZED,xap.xml.XmlTokens.FALSE);
 		this.writeBackAttribute(xap.xml.XmlTokens.MAXIMIZED,xap.xml.XmlTokens.TRUE);		
@@ -277,4 +283,10 @@
 		this.writeBackAttribute(xap.xml.XmlTokens.MINIMIZED,xap.xml.XmlTokens.FALSE);
 		this.writeBackAttribute(xap.xml.XmlTokens.MAXIMIZED,xap.xml.XmlTokens.FALSE);		
 	}
- }
\ No newline at end of file
+ }
+ 
+ 
+// xap.bridges.dojo.WindowBridge.prototype.kd = function(evt){
+// 	var foo = -1 ;
+// 	var goo = -1 ;
+// }
\ No newline at end of file

Modified: incubator/xap/trunk/src/xap/widgets/dojo/Window.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/widgets/dojo/Window.js?view=diff&rev=477871&r1=477870&r2=477871
==============================================================================
--- incubator/xap/trunk/src/xap/widgets/dojo/Window.js (original)
+++ incubator/xap/trunk/src/xap/widgets/dojo/Window.js Tue Nov 21 12:31:18 2006
@@ -57,19 +57,23 @@
 		// Show just the top bar:
 		this.resizeTo(this.previous.width, 
 			dojo.style.getOuterHeight(this.titleBar) /*+ dojo.style.getOuterHeight(this.resizeBar)*/);
+		
 		this.minimizeAction.style.display="none";
 		
 		var restoreParent = this.restoreAction.parentNode;
 		restoreParent.removeChild(this.restoreAction);
 		restoreParent.appendChild(this.restoreAction);
 		
+		// Keep container node from intruding into titleBar
+		// when minimised:
+		this.containerNode.style.visibility = "hidden" ;
 		
 		this.restoreAction.style.display="";
 		this.windowState="minimized";
 	},
 	
-	restoreWindow:function(evt){
-	
+	restoreWindow:function(evt){	
+		this.containerNode.style.visibility = "visible" ;	
 		if (evt && xap.util.Event.getPreventDefault(evt)){
 			return;
 		}
@@ -77,11 +81,12 @@
 		this.resizeBar.style.visibility="visible" ;
 		
 		xap.widgets.dojo.Window.superclass.restoreWindow.call(this,evt);
+		
 		this.minimizeAction.style.display=this.displayMinimizeAction ? "" : "none";
 	},
 	
 	maximizeWindow:function(evt){
-	
+		this.containerNode.style.visibility = "visible" ;
 		if (evt && xap.util.Event.getPreventDefault(evt)){
 			return;
 		}



Mime
View raw message