Author: phuong_vu
Date: 2011-09-30 06:12:54 -0400 (Fri, 30 Sep 2011)
New Revision: 7573
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIColumnContainer.gtmpl
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIContainer.gtmpl
Log:
GTNPORTAL-2112 Can't DnD UIColumnContainer when language is Arabic
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 2011-09-30
08:45:51 UTC (rev 7572)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js 2011-09-30
10:12:54 UTC (rev 7573)
@@ -414,29 +414,31 @@
* @param layout {string} the layout type which is "row" or "column"
*/
PortalDragDrop.prototype.findInsertPosition = function(components, layout, mouseEvent) {
- var Browser = eXo.core.Browser;
- if (layout == "row") {
- for (var i = 0; i < components.length; i++) {
- var componentTop = Browser.findPosY(components[i]);
- var mouseYInPage = Browser.findMouseYInPage(mouseEvent);
- var componentMIddle = componentTop + Math.round(components[i].offsetHeight /
2);
- if (mouseYInPage > componentMIddle) continue;
- else return i;
- }
-
- return -1;
- } else {
- for (var i = 0; i < components.length; i++) {
- var mouseXInPage = Browser.findMouseXInPage(mouseEvent);
- var componentInTD = eXo.core.DOMUtil.getChildrenByTagName(components[i],
"div")[0];
- var componentX = Browser.findPosX(components[i]);
- if (mouseXInPage > componentX) continue;
- else return i
- }
-
- return -1
- }
-};
+ var Browser = eXo.core.Browser;
+ if (layout == "row") {
+ for (var i = 0; i < components.length; i++) {
+ var componentTop = Browser.findPosY(components[i]);
+ var mouseYInPage = Browser.findMouseYInPage(mouseEvent);
+ var componentMIddle = componentTop + Math.round(components[i].offsetHeight /
2);
+ if (mouseYInPage > componentMIddle) continue;
+ else return i;
+ }
+
+ return -1;
+ } else {
+ for (var i = 0; i < components.length; i++) {
+ var mouseXInPage = Browser.findMouseXInPage(mouseEvent);
+ var componentX = Browser.findPosX(components[i], eXo.core.I18n.isRT());
+ if (eXo.core.I18n.isRT()) {
+ if (mouseXInPage < componentX) continue;
+ } else if (mouseXInPage > componentX ) continue;
+
+ return i;
+ }
+
+ return -1;
+ }
+ };
/**
* Create a div block which show the preview block
Modified:
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIColumnContainer.gtmpl
===================================================================
---
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIColumnContainer.gtmpl 2011-09-30
08:45:51 UTC (rev 7572)
+++
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIColumnContainer.gtmpl 2011-09-30
10:12:54 UTC (rev 7573)
@@ -40,11 +40,11 @@
<div class="VIEW-CONTAINER VIEW-BLOCK">
<%} %>
<%if(hasPermission) {%>
+ <div>
<div class="UIRowContainer <%=(portalMode !=
UIPortalApplication.NORMAL_MODE && uicomponent.getChildren().size() == 0) ?
"EmptyContainer" : ""%>">
- <div>
<%uicomponent.renderChildren();%>
- </div>
</div>
+ </div>
<%} else out.print("<div
class='ProtectedContent'>"+_ctx.appRes("UIPortlet.label.protectedContent")+"</div>");%>
</div>
Modified:
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIContainer.gtmpl
===================================================================
---
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIContainer.gtmpl 2011-09-30
08:45:51 UTC (rev 7572)
+++
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIContainer.gtmpl 2011-09-30
10:12:54 UTC (rev 7573)
@@ -29,26 +29,25 @@
id="${uicomponent.id}" ${cssStyle}
onmouseover="eXo.portal.UIPortal.blockOnMouseOver(event, this, true);"
onmouseout="eXo.portal.UIPortal.blockOnMouseOver(event, this, false);">
- <div class="NormalContainerBlock UIComponentBlock">
-
- <%
- int portalMode = uiPortalApp.getModeState();
- if(portalMode == uiPortalApp.CONTAINER_BLOCK_EDIT_MODE || portalMode ==
uiPortalApp.APP_BLOCK_EDIT_MODE){
- %>
- <div class="LAYOUT-CONTAINER LAYOUT-BLOCK">
- <%} else {%>
- <div class="VIEW-CONTAINER VIEW-BLOCK">
- <%} %>
- <%if(hasPermission) {%>
- <div class="UIRowContainer <%=(portalMode !=
UIPortalApplication.NORMAL_MODE && uicomponent.getChildren().size() == 0) ?
"EmptyContainer" : ""%>">
- <div>
- <%uicomponent.renderChildren();%>
- </div>
- </div>
- <%} else out.print("<div
class='ProtectedContent'>"+_ctx.appRes("UIPortlet.label.protectedContent")+"</div>");%>
- </div>
-
- <%if(portalMode != UIPortalApplication.NORMAL_MODE){%>
+ <div class="NormalContainerBlock UIComponentBlock">
+ <%
+ int portalMode = uiPortalApp.getModeState();
+ if(portalMode == uiPortalApp.CONTAINER_BLOCK_EDIT_MODE || portalMode ==
uiPortalApp.APP_BLOCK_EDIT_MODE){
+ %>
+ <div class="LAYOUT-CONTAINER LAYOUT-BLOCK">
+ <%} else {%>
+ <div class="VIEW-CONTAINER VIEW-BLOCK">
+ <%} %>
+ <%if(hasPermission) {%>
+ <div>
+ <div class="UIRowContainer <%=(portalMode !=
UIPortalApplication.NORMAL_MODE && uicomponent.getChildren().size() == 0) ?
"EmptyContainer" : ""%>">
+ <%uicomponent.renderChildren();%>
+ </div>
+ </div>
+ <%} else out.print("<div
class='ProtectedContent'>"+_ctx.appRes("UIPortlet.label.protectedContent")+"</div>");%>
+ </div>
+
+ <%if(portalMode != UIPortalApplication.NORMAL_MODE){%>
<div class="EDITION-BLOCK EDITION-CONTAINER" style="display:
none;position: relative;">
<div style="position: absolute; top: -86px;">
<div class="NewLayer" style="display: none; visibility:
hidden;"><span></span></div>
@@ -74,4 +73,4 @@
</div>
<%} %>
</div>
-</div>
\ No newline at end of file
+</div>