Author: tan_pham_dinh
Date: 2010-01-18 23:29:07 -0500 (Mon, 18 Jan 2010)
New Revision: 1357
Modified:
portal/trunk/component/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboard.java
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIDashboard.js
Log:
GTNPORTAL-418: IE: Still action on DashboardWorkspace when switch view mode
Modified:
portal/trunk/component/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboard.java
===================================================================
---
portal/trunk/component/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboard.java 2010-01-19
03:46:32 UTC (rev 1356)
+++
portal/trunk/component/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboard.java 2010-01-19
04:29:07 UTC (rev 1357)
@@ -53,7 +53,7 @@
public UIDashboard() throws Exception
{
- UIPopupWindow popup = addChild(UIPopupWindow.class, null, GADGET_POPUP_ID);
+ UIPopupWindow popup = addChild(UIPopupWindow.class, null, GADGET_POPUP_ID +
"-" + hashCode());
popup.setUIComponent(createUIComponent(UIDashboardSelectContainer.class, null,
null));
addChild(UIDashboardContainer.class, null, null).setColumns(3);
}
@@ -82,7 +82,7 @@
public void setShowSelectPopup(final boolean value)
{
this.isShowSelectPopup = value;
- ((UIPopupWindow)getChildById(GADGET_POPUP_ID)).setShow(value);
+ getChild(UIPopupWindow.class).setShow(value);
}
public String getAggregatorId()
@@ -118,7 +118,7 @@
boolean isShow =
Boolean.parseBoolean(pcontext.getRequestParameter("isShow"));
uiDashboard.setShowSelectPopup(isShow);
String windowId =
uiDashboard.getChild(UIDashboardContainer.class).getWindowId();
-
event.getRequestContext().addUIComponentToUpdateByAjax(uiDashboard.getChildById(GADGET_POPUP_ID));
+
event.getRequestContext().addUIComponentToUpdateByAjax(uiDashboard.getChild(UIPopupWindow.class));
if (isShow)
{
event.getRequestContext().getJavascriptManager().addCustomizedOnLoadScript(
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIDashboard.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIDashboard.js 2010-01-19
03:46:32 UTC (rev 1356)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIDashboard.js 2010-01-19
04:29:07 UTC (rev 1357)
@@ -275,10 +275,9 @@
portletFragment.style.overflow = "hidden" ;
if(eXo.core.Browser.isIE6()) gadgetContainer.style.width = "99.5%";
- var selectPopup = DOMUtil.findDescendantById(uiDashboard,
"UIAddGadgetPopup");
+ var selectPopup = DOMUtil.findPreviousElementByTagName(uiContainer, "div");
var closeButton = DOMUtil.findFirstDescendantByClass(selectPopup, "div",
"CloseButton");
closeButton.onclick = eXo.webui.UIDashboard.showHideSelectContainer;
- var uiSelect = DOMUtil.findFirstDescendantByClass(selectPopup, "div",
"UIDashboardSelectContainer");
var colsContainer = DOMUtil.findFirstChildByClass(gadgetContainer, "div",
"UIColumns");
var columns = DOMUtil.findChildrenByClass(colsContainer, "div",
"UIColumn");
@@ -291,6 +290,7 @@
colsContainer.style.width = "100%" ;
eXo.webui.UIDashboard.initHeight(windowId) ;
+ eXo.webui.UIDashboard.initPopup(windowId);
setTimeout("eXo.webui.UIDashboard.initDragDrop('" + windowId +
"'," + canEdit + ");", 300) ;
};
@@ -385,6 +385,15 @@
}
};
+ UIDashboard.prototype.initPopup = function(windowId) {
+ var uiWindow = document.getElementById(windowId);
+ var uiDashboardCont = eXo.core.DOMUtil.findFirstDescendantByClass(uiWindow,
"div", "UIDashboardContainer");
+ var popup = eXo.core.DOMUtil.findPreviousElementByTagName(uiDashboardCont,
"div");
+ if(!popup || popup.style.display == "none") return;
+ var deltaY = Math.ceil((uiWindow.offsetHeight - popup.offsetHeight) / 2);
+ popup.style.top = eXo.core.Browser.findPosY(uiWindow) + deltaY + "px";
+ };
+
UIDashboard.prototype.createTarget = function(width, height) {
var uiTarget = document.createElement("div");
uiTarget.id = "UITarget";
@@ -408,8 +417,8 @@
var comp = eXo.core.Browser.getEventSource(event);
var uiDashboardPortlet = DOMUtil.findAncestorByClass(comp, "UIDashboard");
var portletFragment = DOMUtil.findAncestorByClass(uiDashboardPortlet,
"PORTLET-FRAGMENT");
- var uiSelectPopup = DOMUtil.findDescendantById(uiDashboardPortlet,
"UIAddGadgetPopup");
var uiContainer = DOMUtil.findFirstDescendantByClass(uiDashboardPortlet,
"div", "UIDashboardContainer");
+ var uiSelectPopup = DOMUtil.findPreviousElementByTagName(uiContainer,
"div");
var addButton = DOMUtil.findFirstDescendantByClass(uiContainer, "div",
"ContainerControlBarL");
var params;