[gatein-commits] gatein SVN: r4114 - in portal/branches/branch-r4047: 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 Sep 9 03:29:39 EDT 2010
Author: phuong_vu
Date: 2010-09-09 03:29:38 -0400 (Thu, 09 Sep 2010)
New Revision: 4114
Modified:
portal/branches/branch-r4047/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js
portal/branches/branch-r4047/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js
portal/branches/branch-r4047/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl
portal/branches/branch-r4047/webui/framework/src/main/java/org/exoplatform/webui/core/UIPopupMessages.java
Log:
GTNPORTAL-1444 Still click Abort/Finish on Edit Inline Composer when pop-up mesage still is open
Modified: portal/branches/branch-r4047/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js
===================================================================
--- portal/branches/branch-r4047/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js 2010-09-09 07:11:14 UTC (rev 4113)
+++ portal/branches/branch-r4047/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js 2010-09-09 07:29:38 UTC (rev 4114)
@@ -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,11 +122,10 @@
* 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.id = "MaskLayer" ;
maskLayer.maxZIndex = 4; //3 ;
maskLayer.style.width = Browser.getBrowserWidth() + "px";
maskLayer.style.height = Browser.getBrowserHeight() + "px";
@@ -185,9 +185,13 @@
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) ;
@@ -278,7 +282,7 @@
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 ;
Modified: portal/branches/branch-r4047/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js
===================================================================
--- portal/branches/branch-r4047/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js 2010-09-09 07:11:14 UTC (rev 4113)
+++ portal/branches/branch-r4047/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js 2010-09-09 07:29:38 UTC (rev 4114)
@@ -68,12 +68,18 @@
} ;
UIPopupWindow.prototype.showMask = function(popup, isShowPopup) {
- var maskId = popup.id + "MaskLayer" ;
- var mask = document.getElementById(maskId) ;
+ var mask = popup.previousSibling;
if(isShowPopup) {
- if (mask == null) eXo.core.UIMaskLayer.createMaskForFrame(popup.parentNode, popup, 1) ;
+ //Modal if popup is portal component
+ if (popup.parentNode.id == "UIPortalApplication") {
+ eXo.core.UIMaskLayer.createMask(popup.parentNode, popup, 1) ;
+ } else {
+ //If popup is portlet's component, modal with just its parent
+ eXo.core.UIMaskLayer.createMaskForFrame(popup.parentNode, popup, 1) ;
+ }
} else {
- if(mask != null) eXo.core.UIMaskLayer.removeMask(mask) ;
+ //Make sure mask is not TextNode because of previousSibling property
+ if(mask != null && mask.className == "MaskLayer") eXo.core.UIMaskLayer.removeMask(mask) ;
}
} ;
Modified: portal/branches/branch-r4047/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl
===================================================================
--- portal/branches/branch-r4047/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl 2010-09-09 07:11:14 UTC (rev 4113)
+++ portal/branches/branch-r4047/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl 2010-09-09 07:29:38 UTC (rev 4114)
@@ -161,9 +161,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: portal/branches/branch-r4047/webui/framework/src/main/java/org/exoplatform/webui/core/UIPopupMessages.java
===================================================================
--- portal/branches/branch-r4047/webui/framework/src/main/java/org/exoplatform/webui/core/UIPopupMessages.java 2010-09-09 07:11:14 UTC (rev 4113)
+++ portal/branches/branch-r4047/webui/framework/src/main/java/org/exoplatform/webui/core/UIPopupMessages.java 2010-09-09 07:29:38 UTC (rev 4114)
@@ -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