Author: tan_pham_dinh
Date: 2010-02-26 05:03:06 -0500 (Fri, 26 Feb 2010)
New Revision: 1881
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/page/UIPageBody.gtmpl
Log:
GTNPORTAL-739: Bug JS when dragdrop pagebody
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js 2010-02-26
09:57:01 UTC (rev 1880)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js 2010-02-26
10:03:06 UTC (rev 1881)
@@ -249,7 +249,6 @@
if(!targetElement) {
if(!dndEvent.dragObject.isComponent) {
dndEvent.dragObject.parentNode.removeChild(dndEvent.dragObject) ;
- newComponent = true;
}
dndEvent.dragObject.style.width = "auto";
return;
Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js 2010-02-26
09:57:01 UTC (rev 1880)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js 2010-02-26
10:03:06 UTC (rev 1881)
@@ -106,15 +106,11 @@
}
}
- // Don't displat portlet control when View Container
- var controlPortlet = DOMUtil.findFirstDescendantByClass(editBlock, "div",
"CONTROL-PORTLET");
- if (controlPortlet) {
- if(eXo.portal.portalMode == 4) {
- controlPortlet.style.display = "none";
- } else {
- controlPortlet.style.display = "block";
- }
- }
+ // Don't display portlet control when View Container
+ var controlPortlet = DOMUtil.findFirstDescendantByClass(editBlock, "div",
"CONTROL-PORTLET");
+ if (controlPortlet) {
+ controlPortlet.style.display = eXo.portal.portalMode == 4 ? "none" :
"block";
+ }
};
UIPortal.prototype.getUIPortlets = function() {
@@ -351,8 +347,8 @@
this.showUIComponentControl(portal, false) ;
var uiPageDesktop = document.getElementById("UIPageDesktop") ;
+ var pageBody = this.getUIPageBody() ;
if(!uiPageDesktop) {
- var pageBody = this.getUIPageBody() ;
this.switchLayoutModeToViewMode(pageBody, true) ;
this.showUIComponentControl(pageBody, false) ;
}
@@ -369,7 +365,7 @@
this.showUIComponentControl(portlet[i], true) ;
var component = portlet[i].getUIComponentBlock();
var mask = eXo.core.DOMUtil.findFirstDescendantByClass(component, "div",
"UIPortletMask");
- if(eXo.portal.portalMode && mask) {
+ if(eXo.portal.portalMode && mask &&
!eXo.core.DOMUtil.hasAncestor(portlet[i].getElement(), pageBody.getElement())) {
mask.style.display = "block";
mask.style.height = component.offsetHeight + "px";
mask.style.width = component.offsetWidth + "px";
@@ -393,14 +389,9 @@
var pageBodyBlock = pageBody.getUIComponentBlock();
var mask = eXo.core.DOMUtil.findFirstDescendantByClass(pageBodyBlock, "div",
"UIPageBodyMask");
if(mask) {
- if(!(eXo.portal.portalMode%2)) {
- mask.style.top = - pageBodyBlock.offsetHeight + "px";
- mask.style.height = pageBodyBlock.offsetHeight + "px";
- mask.style.width = pageBodyBlock.offsetWidth + "px";
- mask.style.display = "block";
- } else if(mask) {
- mask.style.display = "none";
- }
+ mask.style.top = - pageBodyBlock.offsetHeight + "px";
+ mask.style.height = pageBodyBlock.offsetHeight + "px";
+ mask.style.width = pageBodyBlock.offsetWidth + "px";
}
}
};
@@ -428,17 +419,6 @@
for(var i = 0; i < portlet.length; i++) {
this.switchViewModeToLayoutMode(portlet[i], false) ;
this.showUIComponentControl(portlet[i], this.component == 'UIPortlet') ;
- var component = portlet[i].getUIComponentBlock();
- var mask = eXo.core.DOMUtil.findFirstDescendantByClass(component, "div",
"UIPortletMask");
- if(eXo.portal.portalMode && mask) {
- mask.style.display = "block";
- mask.style.height = component.offsetHeight + "px";
- mask.style.width = component.offsetWidth + "px";
- mask.style.top = eXo.core.Browser.findPosY(component) + "px";
- mask.style.left = eXo.core.Browser.findPosX(component) + "px";
- } else if(mask) {
- mask.style.display = "none";
- }
}
} ;
Modified:
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/page/UIPageBody.gtmpl
===================================================================
---
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/page/UIPageBody.gtmpl 2010-02-26
09:57:01 UTC (rev 1880)
+++
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/page/UIPageBody.gtmpl 2010-02-26
10:03:06 UTC (rev 1881)
@@ -72,11 +72,16 @@
<div class="BMPagebody"><span></span></div>
</div>
</div>
+
+ <%if(portalMode != UIPortalApplication.NORMAL_MODE) {%>
+ <div class="MaskParent" style="height:
0px;position:relative;">
+ <div class="UIPageBodyMask" style="position:absolute;"
onmousedown="eXo.portal.PortalDragDrop.init.call(this,
event);"><span></span></div>
+ </div>
+ <%}%>
</div>
<%}%>
<%if(portalMode != UIPortalApplication.NORMAL_MODE){%>
<div class="EDITION-BLOCK EDITION-PAGEBODY"
style="position:relative">
- <div class="UIPageBodyMask" style="position:absolute;
display:none;" onmousedown="eXo.portal.PortalDragDrop.init.call(this,
event);"><span></span></div>
<div class="CONTROL-PAGEBODY CONTROL-BLOCK" style="display:
none"><span></span></div>
</div>
<%} %>
Show replies by date