Author: thomas.heute(a)jboss.com
Date: 2010-09-23 06:13:58 -0400 (Thu, 23 Sep 2010)
New Revision: 4333
Modified:
epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js
epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl
epp/portal/branches/EPP_5_1_Branch/webui/framework/src/main/java/org/exoplatform/webui/core/UIPopupMessages.java
Log:
JBEPP-490: Still click Abort/Finish on Edit Inline Composer when pop-up mesage still is
open
Modified:
epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js 2010-09-23
10:10:23 UTC (rev 4332)
+++
epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js 2010-09-23
10:13:58 UTC (rev 4333)
@@ -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";
@@ -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:
epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js 2010-09-23
10:10:23 UTC (rev 4332)
+++
epp/portal/branches/EPP_5_1_Branch/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js 2010-09-23
10:13:58 UTC (rev 4333)
@@ -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:
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl 2010-09-23
10:10:23 UTC (rev 4332)
+++
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/groovy/webui/core/UIPopupMessages.gtmpl 2010-09-23
10:13:58 UTC (rev 4333)
@@ -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:
epp/portal/branches/EPP_5_1_Branch/webui/framework/src/main/java/org/exoplatform/webui/core/UIPopupMessages.java
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/webui/framework/src/main/java/org/exoplatform/webui/core/UIPopupMessages.java 2010-09-23
10:10:23 UTC (rev 4332)
+++
epp/portal/branches/EPP_5_1_Branch/webui/framework/src/main/java/org/exoplatform/webui/core/UIPopupMessages.java 2010-09-23
10:13:58 UTC (rev 4333)
@@ -63,6 +63,7 @@
errors_ = new ArrayList<ApplicationMessage>();
warnings_ = new ArrayList<ApplicationMessage>();
infos_ = new ArrayList<ApplicationMessage>();
+ setShowMask(true);
setShow(true);
}
Show replies by date