From fa0b7af3ad7dc79cf52a2aed601691a429aaf71d Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Tue, 26 Nov 2013 14:40:58 +0000 Subject: [PATCH] Fixed window width git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@86193 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../portlets/user/td/client/PortalViewport.java | 14 +++++++++++--- .../user/td/client/TabularDataPortlet.java | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/td/client/PortalViewport.java b/src/main/java/org/gcube/portlets/user/td/client/PortalViewport.java index 8d23766..25f4423 100644 --- a/src/main/java/org/gcube/portlets/user/td/client/PortalViewport.java +++ b/src/main/java/org/gcube/portlets/user/td/client/PortalViewport.java @@ -12,8 +12,10 @@ import com.sencha.gxt.widget.core.client.container.SimpleContainer; import com.sencha.gxt.widget.core.client.container.Viewport.ViewportAppearance; /** - * @author "Federico De Faveri defaveri@isti.cnr.it" * + * @author "Giancarlo Panichi" + * g.panichi@isti.cnr.it + * */ public class PortalViewport extends SimpleContainer { @@ -57,7 +59,7 @@ public class PortalViewport extends SimpleContainer { * * @return true if window scrolling is enabled */ - public boolean getEnableScroll() { + public boolean isEnableScroll() { return enableScroll; } @@ -96,7 +98,13 @@ public class PortalViewport extends SimpleContainer { } protected void resize() { - int viewWidth = calculateWidth() - rightScrollBarSize; + int viewWidth; + if(enableScroll){ + viewWidth= calculateWidth() - rightScrollBarSize; + } else { + viewWidth = calculateWidth(); + } + int viewHeight = calculateHeight(); Log.info("TDM resize viewWidth: " + viewWidth + " viewHeight: " + viewHeight + " clientWidth: " + Window.getClientWidth() diff --git a/src/main/java/org/gcube/portlets/user/td/client/TabularDataPortlet.java b/src/main/java/org/gcube/portlets/user/td/client/TabularDataPortlet.java index 66755d0..c313cb9 100644 --- a/src/main/java/org/gcube/portlets/user/td/client/TabularDataPortlet.java +++ b/src/main/java/org/gcube/portlets/user/td/client/TabularDataPortlet.java @@ -169,6 +169,7 @@ public class TabularDataPortlet implements EntryPoint { + " found, starting in portal mode"); PortalViewport viewport = new PortalViewport(); Log.info("Created Viewport"); + viewport.setEnableScroll(false); viewport.setWidget(mainWidget); Log.info("Set Widget"); Log.info("getOffsetWidth(): " + viewport.getOffsetWidth());