Author: tan_pham_dinh
Date: 2009-10-22 02:55:41 -0400 (Thu, 22 Oct 2009)
New Revision: 395
Removed:
portal/trunk/component/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardMask.java
portal/trunk/component/dashboard/src/main/resources/groovy/dashboard/webui/component/UIDashboardMask.gtmpl
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/UIDashboardContainer.java
portal/trunk/component/dashboard/src/main/resources/groovy/dashboard/webui/component/UIDashboard.gtmpl
portal/trunk/component/dashboard/src/main/resources/groovy/dashboard/webui/component/UIDashboardContainer.gtmpl
portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardPortlet.java
portal/trunk/portlet/dashboard/src/main/webapp/groovy/dashboard/webui/component/UIDashboardPortlet.gtmpl
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/Browser.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/UIGadget.js
portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIDashboard/Stylesheet.css
Log:
GTNPORTAL-49: Re-organize ui components in Dashboard portlet
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 2009-10-21
22:42:44 UTC (rev 394)
+++
portal/trunk/component/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboard.java 2009-10-22
06:55:41 UTC (rev 395)
@@ -19,6 +19,8 @@
package org.exoplatform.dashboard.webui.component;
+import org.exoplatform.portal.webui.application.UIGadget;
+import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.application.portlet.PortletRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.ComponentConfigs;
@@ -32,7 +34,9 @@
@EventConfig(listeners = UIDashboardContainer.MoveGadgetActionListener.class),
@EventConfig(listeners = UIDashboardContainer.AddNewGadgetActionListener.class),
@EventConfig(listeners = UIDashboard.SetShowSelectContainerActionListener.class),
- @EventConfig(listeners = UIDashboardContainer.DeleteGadgetActionListener.class)})})
+ @EventConfig(listeners = UIDashboardContainer.DeleteGadgetActionListener.class),
+ @EventConfig(listeners = UIDashboard.MinimizeGadgetActionListener.class),
+ @EventConfig(listeners = UIDashboard.MaximizeGadgetActionListener.class)})})
public class UIDashboard extends UIContainer
{
@@ -42,6 +46,8 @@
private String aggregatorId;
+ private UIGadget maximizedGadget;
+
public UIDashboard() throws Exception
{
UIPopupWindow popup = addChild(UIPopupWindow.class, null, GADGET_POPUP_ID);
@@ -86,10 +92,19 @@
this.aggregatorId = aggregatorId;
}
- public static class SetShowSelectContainerActionListener extends
- EventListener<org.exoplatform.webui.core.UIContainer>
+ public UIGadget getMaximizedGadget()
{
- public final void execute(final Event<org.exoplatform.webui.core.UIContainer>
event) throws Exception
+ return maximizedGadget;
+ }
+
+ public void setMaximizedGadget(UIGadget gadget)
+ {
+ maximizedGadget = gadget;
+ }
+
+ public static class SetShowSelectContainerActionListener extends
EventListener<UIDashboard>
+ {
+ public final void execute(final Event<UIDashboard> event) throws Exception
{
UIDashboard uiDashboard = (UIDashboard)event.getSource();
if (!uiDashboard.canEdit())
@@ -106,4 +121,43 @@
}
}
}
+
+ public static class MinimizeGadgetActionListener extends
EventListener<UIDashboard>
+ {
+ public final void execute(final Event<UIDashboard> event) throws Exception
+ {
+ WebuiRequestContext context = event.getRequestContext();
+ UIDashboard uiDashboard = event.getSource();
+ String objectId = context.getRequestParameter(OBJECTID);
+ String minimized = context.getRequestParameter("minimized");
+
+ UIGadget uiGadget =
uiDashboard.getChild(UIDashboardContainer.class).getUIGadget(objectId);
+ uiGadget.getProperties().setProperty("minimized", minimized);
+ uiDashboard.getChild(UIDashboardContainer.class).save();
+ context.addUIComponentToUpdateByAjax(uiGadget);
+ }
+ }
+
+ public static class MaximizeGadgetActionListener extends
EventListener<UIDashboard>
+ {
+ public final void execute(final Event<UIDashboard> event) throws Exception
+ {
+ WebuiRequestContext context = event.getRequestContext();
+ UIDashboard uiDashboard = event.getSource();
+ String objectId = context.getRequestParameter(OBJECTID);
+ String maximize = context.getRequestParameter("maximize");
+ UIDashboardContainer uiDashboardCont =
uiDashboard.getChild(UIDashboardContainer.class);
+ UIGadget uiGadget = uiDashboardCont.getUIGadget(objectId);
+ if (maximize.equals("maximize"))
+ {
+ uiGadget.setView(UIGadget.CANVAS_VIEW);
+ uiDashboard.setMaximizedGadget(uiGadget);
+ }
+ else
+ {
+ uiGadget.setView(UIGadget.HOME_VIEW);
+ uiDashboard.setMaximizedGadget(null);
+ }
+ }
+ }
}
Modified:
portal/trunk/component/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardContainer.java
===================================================================
---
portal/trunk/component/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardContainer.java 2009-10-21
22:42:44 UTC (rev 394)
+++
portal/trunk/component/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardContainer.java 2009-10-22
06:55:41 UTC (rev 395)
@@ -30,6 +30,7 @@
import org.exoplatform.portal.webui.application.UIPortlet;
import org.exoplatform.portal.webui.container.UIContainer;
import org.exoplatform.portal.webui.util.PortalDataMapper;
+import org.exoplatform.web.application.RequestContext;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.application.portlet.PortletRequestContext;
import org.exoplatform.webui.config.InitParams;
@@ -107,7 +108,7 @@
{
return;
}
- WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
+ WebuiRequestContext context = RequestContext.getCurrentInstance();
windowId = ((PortletRequestContext)context).getRequest().getWindowID();
Param param = initParams.getParam("ContainerConfigs");
@@ -120,6 +121,7 @@
addChild(UIContainer.class, null, null);
}
+ @Override
public void processRender(WebuiRequestContext context) throws Exception
{
DataStorage service = getApplicationComponent(DataStorage.class);
@@ -288,13 +290,8 @@
*/
public boolean hasUIGadget()
{
- boolean flag = false;
UIGadget gadget = findFirstComponentOfType(UIGadget.class);
- if (gadget != null)
- {
- flag = true;
- }
- return flag;
+ return (gadget != null);
}
/**
@@ -462,13 +459,14 @@
service.execute(new DashboardTask.Save(dashboard));
}
- public static class AddNewGadgetActionListener extends
EventListener<org.exoplatform.webui.core.UIContainer>
+ public static class AddNewGadgetActionListener extends
EventListener<UIDashboard>
{
- public final void execute(final Event<org.exoplatform.webui.core.UIContainer>
event) throws Exception
+ @Override
+ public final void execute(final Event<UIDashboard> event) throws Exception
{
WebuiRequestContext context = event.getRequestContext();
- org.exoplatform.webui.core.UIContainer uiDashboard = event.getSource();
- if (!((UIDashboard)uiDashboard).canEdit())
+ UIDashboard uiDashboard = event.getSource();
+ if (!uiDashboard.canEdit())
return;
int col = Integer.parseInt(context.getRequestParameter(COLINDEX));
int row = Integer.parseInt(context.getRequestParameter(ROWINDEX));
@@ -489,13 +487,14 @@
}
}
- public static class MoveGadgetActionListener extends
EventListener<org.exoplatform.webui.core.UIContainer>
+ public static class MoveGadgetActionListener extends EventListener<UIDashboard>
{
- public final void execute(final Event<org.exoplatform.webui.core.UIContainer>
event) throws Exception
+ @Override
+ public final void execute(final Event<UIDashboard> event) throws Exception
{
WebuiRequestContext context = event.getRequestContext();
- org.exoplatform.webui.core.UIContainer uiDashboard = event.getSource();
- if (!((UIDashboard)uiDashboard).canEdit())
+ UIDashboard uiDashboard = event.getSource();
+ if (!uiDashboard.canEdit())
return;
UIDashboardContainer uiDashboardContainer =
uiDashboard.getChild(UIDashboardContainer.class);
int col = Integer.parseInt(context.getRequestParameter(COLINDEX));
@@ -508,21 +507,28 @@
}
}
- public static class DeleteGadgetActionListener extends
EventListener<org.exoplatform.webui.core.UIContainer>
+ public static class DeleteGadgetActionListener extends
EventListener<UIDashboard>
{
- public final void execute(final Event<org.exoplatform.webui.core.UIContainer>
event) throws Exception
+ @Override
+ public final void execute(final Event<UIDashboard> event) throws Exception
{
- WebuiRequestContext context = event.getRequestContext();
- org.exoplatform.webui.core.UIContainer uiDashboard = event.getSource();
- if (!((UIDashboard)uiDashboard).canEdit())
+ UIDashboard uiDashboard = event.getSource();
+ if (!uiDashboard.canEdit())
return;
+ WebuiRequestContext context = event.getRequestContext();
String objectId = context.getRequestParameter(OBJECTID);
UIDashboardContainer uiDashboardContainer =
uiDashboard.getChild(UIDashboardContainer.class);
uiDashboardContainer.removeUIGadget(objectId);
+ boolean isMaximized = false;
+ if (uiDashboard.getMaximizedGadget() != null &&
uiDashboard.getMaximizedGadget().getId().equals(objectId))
+ {
+ uiDashboard.setMaximizedGadget(null);
+ isMaximized = true;
+ }
uiDashboardContainer.save();
-// context.addUIComponentToUpdateByAjax(uiDashboardContainer);
- context.setResponseComplete(true);
+ if (!isMaximized)
+ context.setResponseComplete(true);
}
}
Deleted:
portal/trunk/component/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardMask.java
===================================================================
---
portal/trunk/component/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardMask.java 2009-10-21
22:42:44 UTC (rev 394)
+++
portal/trunk/component/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardMask.java 2009-10-22
06:55:41 UTC (rev 395)
@@ -1,32 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.exoplatform.dashboard.webui.component;
-
-import org.exoplatform.webui.config.annotation.ComponentConfig;
-import org.exoplatform.webui.core.UIComponentDecorator;
-
-@ComponentConfig(template =
"classpath:groovy/dashboard/webui/component/UIDashboardMask.gtmpl")
-public class UIDashboardMask extends UIComponentDecorator
-{
-
- public UIDashboardMask() throws Exception
- {
- }
-}
Modified:
portal/trunk/component/dashboard/src/main/resources/groovy/dashboard/webui/component/UIDashboard.gtmpl
===================================================================
---
portal/trunk/component/dashboard/src/main/resources/groovy/dashboard/webui/component/UIDashboard.gtmpl 2009-10-21
22:42:44 UTC (rev 394)
+++
portal/trunk/component/dashboard/src/main/resources/groovy/dashboard/webui/component/UIDashboard.gtmpl 2009-10-22
06:55:41 UTC (rev 395)
@@ -1,6 +1,13 @@
+<% def maxiGadget = uicomponent.getMaximizedGadget(); %>
<div id="$uicomponent.id" class="UIDashboard">
- <div class="DashboardContainer">
- <% uicomponent.renderChildren(); %>
- <div class="ClearLeft"><span></span></div>
+ <div class="DashboardContainer <%=maxiGadget == null ? "" :
"Maximized"%>">
+ <%
+ if(maxiGadget == null) {
+ uicomponent.renderChildren();
+ %>
+ <div class="ClearLeft"><span></span></div>
+ <%} else {
+ uicomponent.renderUIComponent(maxiGadget);
+ }%>
</div>
</div>
Modified:
portal/trunk/component/dashboard/src/main/resources/groovy/dashboard/webui/component/UIDashboardContainer.gtmpl
===================================================================
---
portal/trunk/component/dashboard/src/main/resources/groovy/dashboard/webui/component/UIDashboardContainer.gtmpl 2009-10-21
22:42:44 UTC (rev 394)
+++
portal/trunk/component/dashboard/src/main/resources/groovy/dashboard/webui/component/UIDashboardContainer.gtmpl 2009-10-22
06:55:41 UTC (rev 395)
@@ -26,15 +26,8 @@
</div>
</div>
</div>
- <%
- }
- if (uicomponent.findFirstComponentOfType(UIGadget.class) == null) {
- %>
- <div class="NoGadget"><%=
_ctx.appRes("UIDashboard.msg.addGadget"); %></div>
- <%
- }
- uicomponent.renderChildren() ;
- %>
-
+ <%}%>
+ <div class="NoGadget" style="display: <%=uicomponent.hasUIGadget()
? "none" : "block"%>"><%=
_ctx.appRes("UIDashboard.msg.addGadget"); %></div>
+ <% uicomponent.renderChildren() ;%>
</div>
</div>
Deleted:
portal/trunk/component/dashboard/src/main/resources/groovy/dashboard/webui/component/UIDashboardMask.gtmpl
===================================================================
---
portal/trunk/component/dashboard/src/main/resources/groovy/dashboard/webui/component/UIDashboardMask.gtmpl 2009-10-21
22:42:44 UTC (rev 394)
+++
portal/trunk/component/dashboard/src/main/resources/groovy/dashboard/webui/component/UIDashboardMask.gtmpl 2009-10-22
06:55:41 UTC (rev 395)
@@ -1,3 +0,0 @@
-<div id="$uicomponent.id" class="UIDashboardMask">
- <%uicomponent.renderChildren();%>
-</div>
\ No newline at end of file
Modified:
portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardPortlet.java
===================================================================
---
portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardPortlet.java 2009-10-21
22:42:44 UTC (rev 394)
+++
portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardPortlet.java 2009-10-22
06:55:41 UTC (rev 395)
@@ -19,16 +19,12 @@
package org.exoplatform.dashboard.webui.component;
-import org.exoplatform.portal.webui.application.UIGadget;
import org.exoplatform.portal.webui.container.UIContainer;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.application.portlet.PortletRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
-import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIPortletApplication;
import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
-import org.exoplatform.webui.event.Event;
-import org.exoplatform.webui.event.EventListener;
import javax.portlet.PortletPreferences;
@@ -38,9 +34,7 @@
/**
* @author exo
*/
-@ComponentConfig(lifecycle = UIApplicationLifecycle.class, template =
"app:/groovy/dashboard/webui/component/UIDashboardPortlet.gtmpl", events = {
- @EventConfig(listeners = UIDashboardPortlet.MinimizeGadgetActionListener.class),
- @EventConfig(listeners = UIDashboardPortlet.MaximizeGadgetActionListener.class)})
+@ComponentConfig(lifecycle = UIApplicationLifecycle.class, template =
"app:/groovy/dashboard/webui/component/UIDashboardPortlet.gtmpl", events = {})
/**
* Dashboard portlet that display google gadgets
*/
@@ -55,7 +49,6 @@
PortletRequestContext context =
(PortletRequestContext)WebuiRequestContext.getCurrentInstance();
UIDashboard dashboard = addChild(UIDashboard.class, null, null);
- addChild(UIDashboardMask.class, null, null).setRendered(false);
addChild(UIDashboardEditForm.class, null, null);
PortletPreferences pref = context.getRequest().getPreferences();
@@ -103,50 +96,4 @@
return owner;
}
- public static class MinimizeGadgetActionListener extends
EventListener<UIDashboardPortlet>
- {
- public final void execute(final Event<UIDashboardPortlet> event) throws
Exception
- {
- WebuiRequestContext context = event.getRequestContext();
- UIDashboardPortlet uiPortlet = event.getSource();
- String objectId = context.getRequestParameter(OBJECTID);
- String minimized = context.getRequestParameter("minimized");
-
- UIDashboard uiDashboard = uiPortlet.getChild(UIDashboard.class);
- UIGadget uiGadget =
uiDashboard.getChild(UIDashboardContainer.class).getUIGadget(objectId);
- uiGadget.getProperties().setProperty("minimized", minimized);
- uiDashboard.getChild(UIDashboardContainer.class).save();
- context.addUIComponentToUpdateByAjax(uiGadget);
- }
- }
-
- public static class MaximizeGadgetActionListener extends
EventListener<UIDashboardPortlet>
- {
- public final void execute(final Event<UIDashboardPortlet> event) throws
Exception
- {
- WebuiRequestContext context = event.getRequestContext();
- UIDashboardPortlet uiPortlet = event.getSource();
- String objectId = context.getRequestParameter(OBJECTID);
- String maximize = context.getRequestParameter("maximize");
- UIDashboard uiDashboard = uiPortlet.getChild(UIDashboard.class);
- UIDashboardContainer uiDashboardContainer =
uiDashboard.getChild(UIDashboardContainer.class);
- UIDashboardMask uiDashboardMask = uiPortlet.getChild(UIDashboardMask.class);
- UIGadget uiGadget = uiDashboardContainer.getUIGadget(objectId);
- if (maximize.equals("maximize"))
- {
- uiGadget.setView(UIGadget.CANVAS_VIEW);
- uiDashboardMask.setUIComponent(uiGadget);
- uiDashboardMask.setRendered(true);
- uiDashboard.setRendered(false);
- }
- else
- {
- uiGadget.setView(UIGadget.HOME_VIEW);
- uiDashboardMask.setUIComponent(null);
- uiDashboardMask.setRendered(false);
- uiDashboard.setRendered(true);
- }
- //context.addUIComponentToUpdateByAjax(uiPortlet) ;
- }
- }
}
Modified:
portal/trunk/portlet/dashboard/src/main/webapp/groovy/dashboard/webui/component/UIDashboardPortlet.gtmpl
===================================================================
---
portal/trunk/portlet/dashboard/src/main/webapp/groovy/dashboard/webui/component/UIDashboardPortlet.gtmpl 2009-10-21
22:42:44 UTC (rev 394)
+++
portal/trunk/portlet/dashboard/src/main/webapp/groovy/dashboard/webui/component/UIDashboardPortlet.gtmpl 2009-10-22
06:55:41 UTC (rev 395)
@@ -2,7 +2,6 @@
import javax.portlet.PortletMode ;
import org.exoplatform.dashboard.webui.component.DashboardParent ;
import org.exoplatform.dashboard.webui.component.UIDashboard;
- import org.exoplatform.dashboard.webui.component.UIDashboardMask;
import org.exoplatform.dashboard.webui.component.UIDashboardEditForm;
def rcontext = _ctx.getRequestContext() ;
@@ -11,7 +10,6 @@
<div id="$uicomponent.id" class="UIDashboardPortlet">
<% if(rcontext.getApplicationMode() == PortletMode.VIEW) {
uicomponent.renderChild(UIDashboard.class);
- uicomponent.renderChild(UIDashboardMask.class);
} else {
UIDashboardEditForm uiEditForm = uicomponent.getChild(UIDashboardEditForm.class);
uiEditForm.getUIStringInput(UIDashboardEditForm.TOTAL_COLUMNS).setValue(uicomponent.getNumberOfCols()
+ "");
Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/Browser.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/Browser.js 2009-10-21
22:42:44 UTC (rev 394)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/Browser.js 2009-10-22
06:55:41 UTC (rev 395)
@@ -459,7 +459,6 @@
Browser.prototype.findMouseRelativeX = function(object, e) {
var posx = -1 ;
var posXObject = eXo.core.Browser.findPosX(object) ;
- document.title = "test" + posXObject;
/*
* posXObject is added more 3px on IE6
Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/UIGadget.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/UIGadget.js 2009-10-21
22:42:44 UTC (rev 394)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/UIGadget.js 2009-10-22
06:55:41 UTC (rev 395)
@@ -204,9 +204,9 @@
}
var compId = portletFrag.parentNode.id;
- var uicomp = DOMUtil.getChildrenByTagName(portletFrag,
"div")[0].className ;
+ var uicomp = DOMUtil.findAncestorByClass(uiGadget, "UIDashboard") ;
var href = eXo.env.server.portalBaseURL + "?portal:componentId=" +
compId ;
- href += "&portal:type=action&uicomponent=" + uicomp;
+ href += "&portal:type=action&uicomponent=" + uicomp.id;
href += "&op=MinimizeGadget";
href += "&minimized=" + minimized;
href += "&objectId=" + uiGadget.id +
"&ajaxRequest=true";
@@ -219,11 +219,10 @@
var uiGadget = DOMUtil.findAncestorByClass(selectedElement, "UIGadget")
;
var portletFrag = DOMUtil.findAncestorByClass(uiGadget,
"PORTLET-FRAGMENT") ;
if (!portletFrag) return;
- var maximize = "maximize";
var compId = portletFrag.parentNode.id;
- var uicomp = DOMUtil.getChildrenByTagName(portletFrag, "div")[0];
- var compDisplay =
DOMUtil.findFirstChildByClass(uicomp,"div","UIDashboardMask");
- if(compDisplay != null) maximize = "unmaximize"
+ var uicomp = DOMUtil.findAncestorByClass(uiGadget, "UIDashboard");
+ var compDisplay = DOMUtil.findAncestorByClass(uiGadget,
"UIDashboardContainer");
+ var maximize = compDisplay ? "maximize" : "unmaximize";
var href = eXo.env.server.portalBaseURL + "?portal:componentId=" +
compId ;
href += "&portal:type=action&uicomponent=" + uicomp.id;
href += "&op=MaximizeGadget";
@@ -242,19 +241,28 @@
if (portletFragment != null) {
var compId = portletFragment.parentNode.id;
- var uicomp = "";
- if (DOMUtil.findChildrenByClass(portletFragment, "div",
"UIDashboard")) {
- uicomp = "UIDashboard";
- }
- else
- uicomp = DOMUtil.getChildrenByTagName(portletFragment,
"div")[0].className;
+ var uicomp = DOMUtil.findAncestorByClass(uiGadget,
"UIDashboard").id;
+// if (DOMUtil.findChildrenByClass(portletFragment, "div",
"UIDashboard"))
+// uicomp = "UIDashboard";
+// else
+// uicomp = DOMUtil.getChildrenByTagName(portletFragment,
"div")[0].className;
if (confirm(this.confirmDeleteGadget)) {
var href = eXo.env.server.portalBaseURL +
"?portal:componentId=" + compId;
href += "&portal:type=action&uicomponent=" + uicomp;
href += "&op=DeleteGadget";
href += "&objectId=" + uiGadget.id +
"&ajaxRequest=true";
- DOMUtil.removeElement(uiGadget);
- ajaxAsyncGetRequest(href);
+
+ var uiDashboardCont = DOMUtil.findAncestorByClass(uiGadget,
"UIDashboardContainer");
+ if(uiDashboardCont) {
+ ajaxAsyncGetRequest(href);
+ DOMUtil.removeElement(uiGadget);
+ if(!DOMUtil.findFirstDescendantByClass(uiDashboardCont, "div",
"UIGadget")) {
+ DOMUtil.findFirstDescendantByClass(uiDashboardCont, "div",
"NoGadget").style.display = "block";
+ }
+ }else {
+// Case: delete gadget in dashboard when maximized gadget
+ ajaxGet(href);
+ }
}
} else {
Modified:
portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIDashboard/Stylesheet.css
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIDashboard/Stylesheet.css 2009-10-21
22:42:44 UTC (rev 394)
+++
portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIDashboard/Stylesheet.css 2009-10-22
06:55:41 UTC (rev 395)
@@ -35,7 +35,6 @@
.UIDashboard {
height: 100%;
- background: url('background/BgRepeat.gif') repeat-y left bottom;
}
.UIDashboard .DashboardContainer {
@@ -514,30 +513,30 @@
#UIAddGadgetPopup .PopupTitle {
margin-left: 22px;
}
-/*----------------------UIDashboardMask-------------------*/
+/*----------------------Maximized-------------------*/
-.UIDashboardMask .UIGadget {
+.Maximized .UIGadget {
padding: 5px;
margin: 0px;
}
-.UIDashboardMask .UIGadget .GadgetControl {
+.Maximized .UIGadget .GadgetControl {
float: none;
padding: 0px;
height: auto; width: auto;
}
-.UIDashboardMask .UIGadget .GadgetControl .LeftControlBar {
+.Maximized .UIGadget .GadgetControl .LeftControlBar {
background: none;
padding: 0px;
}
-.UIDashboardMask .UIGadget .GadgetControl .RightControlBar {
+.Maximized .UIGadget .GadgetControl .RightControlBar {
background: none;
padding: 0px;
}
-.UIDashboardMask .UIGadget .GadgetControl .CenterControlBar {
+.Maximized .UIGadget .GadgetControl .CenterControlBar {
background: url('background/BgTitleGadget.gif') repeat-x left top;
height: 23px;
line-height: 23px;
@@ -546,31 +545,31 @@
border-top: none;
}
-.UIDashboardMask .UIGadget .GadgetControl .GadgetDragHandleArea {
+.Maximized .UIGadget .GadgetControl .GadgetDragHandleArea {
display: none;
}
-.UIDashboardMask .UIGadget .TLGadget {
+.Maximized .UIGadget .TLGadget {
display: none;
}
-.UIDashboardMask .UIGadget .MLGadget {
+.Maximized .UIGadget .MLGadget {
background: #f2f2f3;
border: 1px solid #c3c3c3;
border-top: none;
padding: 3px;
}
-.UIDashboardMask .UIGadget .MRGadget {
+.Maximized .UIGadget .MRGadget {
background: white;
padding: 0 0 1px;
}
-.UIDashboardMask .UIGadget .BLGadget {
+.Maximized .UIGadget .BLGadget {
display: none;
}
-.UIDashboardMask .GadgetTitle {
+.Maximized .GadgetTitle {
float: left; /* orientation=lt */
float: right; /* orientation=rt */
padding: 0px 5px;
@@ -581,6 +580,6 @@
white-space: nowrap;
}
-.UIDashboardMask iframe {
+.Maximized iframe {
width: 100%;
}
\ No newline at end of file