[gatein-commits] gatein SVN: r5150 - in exo/portal/branches/3.1.x: web/eXoResources/src/main/webapp/javascript/eXo/webui and 2 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Nov 18 02:58:07 EST 2010


Author: phuong_vu
Date: 2010-11-18 02:58:06 -0500 (Thu, 18 Nov 2010)
New Revision: 5150

Modified:
   exo/portal/branches/3.1.x/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js
   exo/portal/branches/3.1.x/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js
   exo/portal/branches/3.1.x/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl
   exo/portal/branches/3.1.x/webui/core/src/main/java/org/exoplatform/webui/core/UIPopupMessages.java
Log:
EXOGTN-164 [PLF] Still click Abort/Finish on Edit Inline Composer when pop-up mesage still is open

Modified: exo/portal/branches/3.1.x/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js
===================================================================
--- exo/portal/branches/3.1.x/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js	2010-11-18 07:41:14 UTC (rev 5149)
+++ exo/portal/branches/3.1.x/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js	2010-11-18 07:58:06 UTC (rev 5150)
@@ -107,7 +107,8 @@
 UIMaskLayer.prototype.createMask = function(blockContainerId, object, opacity, position) {
 	try {
 		var Browser = eXo.core.Browser ;
-		var blockContainer = document.getElementById(blockContainerId) ;
+		if(typeof(blockContainerId) == "string") blockContainerId = document.getElementById(blockContainerId) ;
+		var blockContainer = blockContainerId ;
 		var maskLayer = document.createElement("div") ;
 		
 		this.object = object ;
@@ -121,12 +122,11 @@
 			 * reference with method eXo.core.UIMaskLayer.doScroll()
 			 */
 			document.getElementById("MaskLayer").id = "subMaskLayer";
-		}
-		blockContainer.appendChild(maskLayer) ;
-		
+		} 
+		blockContainer.appendChild(maskLayer) ;		
 		maskLayer.className = "MaskLayer" ;
-		maskLayer.id = "MaskLayer" ;
-		maskLayer.maxZIndex = 4; //3 ;
+		maskLayer.id = "MaskLayer" ;		
+		maskLayer.maxZIndex = eXo.webui.UIPopup.zIndex + 1; //3 ;
 		maskLayer.style.width = Browser.getBrowserWidth() + "px";
 		maskLayer.style.height = Browser.getBrowserHeight() + "px";
 		maskLayer.style.top = "0px" ;
@@ -137,14 +137,14 @@
 	    	Browser.setOpacity(maskLayer, opacity) ;
 		}
 																		
-		if(object != null){
-			if(object.nextSibling) {
-			  maskLayer.nextSiblingOfObject = object.nextSibling ;
-			  maskLayer.parentOfObject = null ;
+		if(object != null) {
+			var tempNextSibling = document.createElement("span");
+			if(object.nextSibling) {				
+				object.parentNode.insertBefore(tempNextSibling, object.nextSibling);			  			
 			} else {
-			  maskLayer.nextSiblingOfObject = null ;
-			  maskLayer.parentOfObject = object.parentNode ;
+				object.parentNode.appendChild(tempNextSibling);
 			}
+			maskLayer.nextSiblingOfObject = tempNextSibling ;
 			
 			//object.style.zIndex = maskLayer.maxZIndex + 1 ;
 			object.style.zIndex = maskLayer.maxZIndex;			
@@ -185,27 +185,31 @@
 		maskLayer.id = object.id + "MaskLayer" ;
 		maskLayer.maxZIndex = 3 ;
 		maskLayer.style.width = blockContainer.offsetWidth + "px"  ;
-		maskLayer.style.height =  blockContainer.offsetHeight + eXo.core.Browser.findPosY(blockContainer) + "px"  ;
-		maskLayer.style.top = "0px" ;
-		maskLayer.style.left = "0px" ;
+		maskLayer.style.height =  blockContainer.offsetHeight + "px"  ;
+		var parentOfBlockContainer = eXo.core.DOMUtil.findAncestorById(blockContainer, "UIMaskWorkspace");
+		if (!parentOfBlockContainer) {
+			parentOfBlockContainer = document.getElementById("UIWorkingWorkspace");
+		}
+		maskLayer.style.top = eXo.core.Browser.findPosYInContainer(blockContainer, parentOfBlockContainer) + "px" ;
+		maskLayer.style.left = eXo.core.Browser.findPosXInContainer(blockContainer, parentOfBlockContainer) + "px" ;		
 		maskLayer.style.zIndex = maskLayer.maxZIndex ;
 		if(opacity) {
 	    Browser.setOpacity(maskLayer, opacity) ;
 		}
 		
 		if(object != null){
-			if(object.nextSibling) {
-			  maskLayer.nextSiblingOfObject = object.nextSibling ;
-			  maskLayer.parentOfObject = null ;
-				} else {
-				  maskLayer.nextSiblingOfObject = null ;
-				  maskLayer.parentOfObject = object.parentNode ;
-				}
+			var tempNextSibling = document.createElement("span");
+			if(object.nextSibling) {				
+				object.parentNode.insertBefore(tempNextSibling, object.nextSibling);			  			
+			} else {
+				object.parentNode.appendChild(tempNextSibling);
+			}
+			maskLayer.nextSiblingOfObject = tempNextSibling ;
+			
+			object.style.zIndex = maskLayer.maxZIndex + 1 ;
+			object.style.display = "block" ;
 				
-				object.style.zIndex = maskLayer.maxZIndex + 1 ;
-				object.style.display = "block" ;
-				
-				blockContainer.appendChild(object) ;
+			blockContainer.appendChild(object) ;
 	  }
 		
 	}catch(err) {}
@@ -278,17 +282,12 @@
 	if (maskLayer) {
 	  var parentNode = maskLayer.parentNode ;
 	  maskLayer.nextSibling.style.display = "none" ;
-  
-	  if (maskLayer.nextSiblingOfObject) {
-	  	maskLayer.nextSiblingOfObject.parentNode.insertBefore(maskLayer.nextSibling, maskLayer.nextSiblingOfObject) ;
-	  	maskLayer.nextSiblingOfObject = null ;
-	  } else {
-	  	maskLayer.parentOfObject.appendChild(maskLayer.nextSibling) ;
-	  	maskLayer.parentOfObject = null ;
-	  }
-
-  	parentNode.removeChild(maskLayer) ;
+	  
+	  maskLayer.nextSiblingOfObject.parentNode.insertBefore(maskLayer.nextSibling, maskLayer.nextSiblingOfObject) ;
+  	maskLayer.nextSiblingOfObject.parentNode.removeChild(maskLayer.nextSiblingOfObject);
   	
+  	maskLayer.nextSiblingOfObject = null ;
+  	parentNode.removeChild(maskLayer) ;  	
 	}
 } ;
 

Modified: exo/portal/branches/3.1.x/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js
===================================================================
--- exo/portal/branches/3.1.x/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js	2010-11-18 07:41:14 UTC (rev 5149)
+++ exo/portal/branches/3.1.x/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js	2010-11-18 07:58:06 UTC (rev 5150)
@@ -71,12 +71,21 @@
 } ;
 
 UIPopupWindow.prototype.showMask = function(popup, isShowPopup) {
-	var maskId = popup.id + "MaskLayer" ;
-	var mask = document.getElementById(maskId) ;
+	var mask = popup.previousSibling;
+  //Make sure mask is not TextNode because of previousSibling property
+	if (mask && mask.className != "MaskLayer") {
+		mask = null;
+	}
 	if(isShowPopup) {
-		if (mask == null) eXo.core.UIMaskLayer.createMaskForFrame(popup.parentNode, popup, 1) ;			
+		//Modal if popup is portal component
+		if (eXo.core.DOMUtil.findAncestorByClass(popup, "PORTLET-FRAGMENT") == null) {
+			if(!mask) eXo.core.UIMaskLayer.createMask(popup.parentNode, popup, 1) ;
+		} else {
+			//If popup is portlet's component, modal with just its parent
+			if(!mask) eXo.core.UIMaskLayer.createMaskForFrame(popup.parentNode, popup, 1) ;
+		}
 	} else {
-		if(mask != null)	eXo.core.UIMaskLayer.removeMask(mask) ;			
+		if(mask) eXo.core.UIMaskLayer.removeMask(mask) ;
 	}
 } ;
 

Modified: exo/portal/branches/3.1.x/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl
===================================================================
--- exo/portal/branches/3.1.x/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl	2010-11-18 07:41:14 UTC (rev 5149)
+++ exo/portal/branches/3.1.x/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl	2010-11-18 07:58:06 UTC (rev 5150)
@@ -155,9 +155,9 @@
 		</div>
 	</div>
 	<%
-		rcontext.getJavascriptManager().addJavascript("eXo.webui.UIPopupWindow.init('$popupId', false);");
+		rcontext.getJavascriptManager().addJavascript("eXo.webui.UIPopupWindow.init('$popupId', false, null, null, $uicomponent.showMask);");
 		if(uicomponent.hasMessage()){
-			rcontext.getJavascriptManager().addJavascript("eXo.webui.UIPopupWindow.show('$popupId');");
+			rcontext.getJavascriptManager().addJavascript("eXo.webui.UIPopupWindow.show('$popupId', $uicomponent.showMask);");
 			rcontext.getJavascriptManager().addJavascript("window.setTimeout(\"eXo.webui.UIPopupWindow.increasezIndex('$popupId')\", 100);");
 		}
 	%>
\ No newline at end of file

Modified: exo/portal/branches/3.1.x/webui/core/src/main/java/org/exoplatform/webui/core/UIPopupMessages.java
===================================================================
--- exo/portal/branches/3.1.x/webui/core/src/main/java/org/exoplatform/webui/core/UIPopupMessages.java	2010-11-18 07:41:14 UTC (rev 5149)
+++ exo/portal/branches/3.1.x/webui/core/src/main/java/org/exoplatform/webui/core/UIPopupMessages.java	2010-11-18 07:58:06 UTC (rev 5150)
@@ -63,6 +63,7 @@
       errors_ = new ArrayList<ApplicationMessage>();
       warnings_ = new ArrayList<ApplicationMessage>();
       infos_ = new ArrayList<ApplicationMessage>();
+      setShowMask(true);
       setShow(true);
    }
 



More information about the gatein-commits mailing list