Author: phuong_vu
Date: 2011-08-31 02:16:07 -0400 (Wed, 31 Aug 2011)
New Revision: 7257
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js
Log:
GTNPORTAL-2035 infinite page scrolling in edit permission settings for new portal
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js 2011-08-30
18:30:04 UTC (rev 7256)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/UIMaskLayer.js 2011-08-31
06:16:07 UTC (rev 7257)
@@ -127,8 +127,17 @@
maskLayer.className = "MaskLayer" ;
maskLayer.id = "MaskLayer" ;
maskLayer.maxZIndex = eXo.webui.UIPopup.zIndex + 1; //3 ;
- maskLayer.style.width = Browser.getBrowserWidth() + "px";
- maskLayer.style.height = Browser.getBrowserHeight() + "px";
+
+ var offsetParent = maskLayer.offsetParent;
+ if (offsetParent && eXo.core.Browser.findPosX(offsetParent) != 0
+ && eXo.core.Browser.findPosY(offsetParent) != 0) {
+ maskLayer.style.width = offsetParent.offsetWidth + "px";
+ maskLayer.style.height = offsetParent.offsetHeight + "px";
+ } else {
+ maskLayer.style.width = Browser.getBrowserWidth() + "px";
+ maskLayer.style.height = Browser.getBrowserHeight() + "px";
+ }
+
maskLayer.style.top = "0px" ;
maskLayer.style.left = "0px" ;
maskLayer.style.zIndex = maskLayer.maxZIndex ;
@@ -166,7 +175,7 @@
}catch(err) {
alert(err) ;
}
- Browser.addOnResizeCallback(maskLayer.id, eXo.core.UIMaskLayer.resizeMaskLayer);
+ Browser.addOnResizeCallback(maskLayer.id, eXo.core.UIMaskLayer.resizeMaskLayer);
return maskLayer ;
};
@@ -221,8 +230,14 @@
*/
UIMaskLayer.prototype.doScroll = function() {
- if(document.getElementById("MaskLayer")) {
- var maskLayer = document.getElementById("MaskLayer") ;
+ var maskLayer = document.getElementById("MaskLayer") ;
+ if(maskLayer) {
+ var offsetParent = maskLayer.offsetParent;
+ if (offsetParent && eXo.core.Browser.findPosX(offsetParent) != 0
+ || eXo.core.Browser.findPosY(offsetParent) != 0) {
+ maskLayer = document.getElementById("subMaskLayer");
+ if (!maskLayer) return;
+ }
if(document.documentElement && document.documentElement.scrollTop) {
maskLayer.style.top = document.documentElement.scrollTop + "px" ;
} else {
@@ -243,10 +258,17 @@
UIMaskLayer.prototype.setPosition = function() {
var UIMaskLayer = eXo.core.UIMaskLayer ;
var Browser = eXo.core.Browser ;
- var object = UIMaskLayer.object ;
- var blockContainer = UIMaskLayer.blockContainer ;
+ var object = UIMaskLayer.object ;
+ if (object && object.previousSibling) {
+ var offsetParent = object.previousSibling.offsetParent;
+ if (offsetParent && (eXo.core.Browser.findPosX(offsetParent) != 0
+ || eXo.core.Browser.findPosY(offsetParent) != 0)) {
+ eXo.portal.UIMaskWorkspace.resetPosition();
+ }
+ }
+ var blockContainer = UIMaskLayer.blockContainer ;
var position = UIMaskLayer.position ;
- object.style.position = "absolute" ;
+ object.style.position = "absolute" ;
var left ;
var top ;
@@ -271,6 +293,9 @@
left = (blockContainer.offsetWidth - object.offsetWidth) / 2 ;
top = (Browser.getBrowserHeight() - object.offsetHeight) / 2 + topPos ;
}
+ if ((top + object.offsetHeight) > topPos + Browser.getBrowserHeight()) {
+ top = topPos + Browser.getBrowserHeight() - object.offsetHeight;
+ }
object.style.left = left + "px" ;
object.style.top = top + "px" ;
@@ -308,7 +333,18 @@
UIMaskLayer.prototype.resizeMaskLayer = function() {
var maskLayer = document.getElementById("MaskLayer");
- if (maskLayer) {
+ if (maskLayer) {
+ var offsetParent = maskLayer.offsetParent;
+ if (offsetParent && (eXo.core.Browser.findPosX(offsetParent) != 0
+ || eXo.core.Browser.findPosY(offsetParent) != 0)) {
+ maskLayer = document.getElementById("subMaskLayer");
+ if (!maskLayer) return;
+ offsetParent = maskLayer.offsetParent;
+ }
+ }
+
+ if (maskLayer && offsetParent && eXo.core.Browser.findPosX(offsetParent)
== 0
+ && eXo.core.Browser.findPosY(offsetParent) == 0) {
maskLayer.style.width = eXo.core.Browser.getBrowserWidth() + "px";
maskLayer.style.height = eXo.core.Browser.getBrowserHeight() + "px";
}
Show replies by date