Fixed collapsible tree panel when workspace is displayed on the phone

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@146855 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2017-04-13 11:57:13 +00:00
parent 9aefd7e87f
commit aa78385090
5 changed files with 40 additions and 32 deletions

View File

@ -4,6 +4,7 @@ import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.logical.shared.ResizeEvent;
import com.google.gwt.event.logical.shared.ResizeHandler;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.RootPanel;
@ -30,13 +31,22 @@ public class WorkspacePortlet implements EntryPoint {
public void onResize(ResizeEvent event) {
GWT.log("onWindowResized width: "+event.getWidth()+" height: "+event.getHeight());
updateSize();
updateTreePanelSize();
}
});
updateSize();
// showGuidedTour();
}
private void updateTreePanelSize() {
int rootWidth = Window.getClientWidth() - 2* RootPanel.get(ConstantsPortlet.WORKSPACEDIV).getAbsoluteLeft();
if (rootWidth < ConstantsPortlet.HIDE_TREE_PANEL_WHEN_WIDTH_LESS_THAN) {
appController.getMainPanel().collapseTreePanel();
GWT.log("Collapses tree panel");
appController.getMainPanel().layout(true);
}
}
/**
* Update window size
*/
@ -55,12 +65,10 @@ public class WorkspacePortlet implements EntryPoint {
GWT.log("New workspace dimension Height: "+rootHeight+" Width: "+rootWidth);
appController.getMainPanel().setHeight(rootHeight);
appController.getMainPanel().setWidth(rootWidth);
if (rootWidth < ConstantsPortlet.HIDE_TREE_PANEL_WHEN_WIDTH_LESS_THAN) {
appController.getMainPanel().collapseTreePanel();
GWT.log("Collapses tree panel");
}
}
// private void showGuidedTour() {
// GWT.runAsync(GCUBEGuidedTour.class, new RunAsyncCallback() {
// public void onSuccess() {

View File

@ -245,7 +245,7 @@ public class WorkspaceFeaturesView extends Composite {
overPlk.setWidget(plk);
overPlk.setHeading("Workspace Public Link");
String icon = "<span style=\"margin-right:5px\">"+Resources.getIconPublicLink().getSafeHtml().asString()+"</span>";
overPlk.setText(icon+"Create links to files in your Workspace to download them. You can send the links to anyone by pasting them into Workspace Message, your emails, instant messages, etc.");
overPlk.setText(icon+"Create links to files in your Workspace to download them. You can send the links to anyone by pasting them in your emails, instant messages, etc. Any link always point to the latest version.");
overPlk.setHtml(true);
overPlk.setPlacement(Placement.BOTTOM);
overPlk.setTrigger(Trigger.HOVER);

View File

@ -1,6 +1,5 @@
package org.gcube.portlets.user.workspace.client.view.panels;
import org.gcube.portal.clientcontext.client.GCubeClientContext;
import org.gcube.portlets.user.workspace.client.ConstantsPortlet;
import org.gcube.portlets.user.workspace.client.view.ExplorerPanel;
import org.gcube.portlets.user.workspace.client.view.toolbars.GxtBottomToolBarItem;
@ -19,6 +18,8 @@ import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.google.gwt.user.client.Random;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.RootPanel;
/**
* The Class GxtBorderLayoutPanel.
@ -115,7 +116,16 @@ public class GxtBorderLayoutPanel extends ContentPanel {
// northData.setSplit(true);
northData.setMargins(new Margins(0, 0, 1, 0));
BorderLayoutData westData = new BorderLayoutData(LayoutRegion.WEST, 330,330,400);
int treePanelWidth = 330;
//it makes appear the collapse header for mobiles
int leftBorder = RootPanel.get(ConstantsPortlet.WORKSPACEDIV).getAbsoluteLeft();
int rootWidth = Window.getClientWidth() - 2* leftBorder;
if (rootWidth < ConstantsPortlet.HIDE_TREE_PANEL_WHEN_WIDTH_LESS_THAN) {
west.setHeaderVisible(true);
}
BorderLayoutData westData = new BorderLayoutData(LayoutRegion.WEST, treePanelWidth,treePanelWidth,treePanelWidth+70);
westData.setSplit(true);
westData.setCollapsible(true);
westData.setMargins(new Margins(0,1,0,0));
@ -127,6 +137,8 @@ public class GxtBorderLayoutPanel extends ContentPanel {
eastData.setSplit(true);
eastData.setCollapsible(true);
eastData.setMargins(new Margins(0,0,0,1));
BorderLayoutData southData = new BorderLayoutData(LayoutRegion.SOUTH, 30,30,30);
southData.setSplit(true);
@ -136,6 +148,7 @@ public class GxtBorderLayoutPanel extends ContentPanel {
north.add(this.searchAndFilterContainer);
north.setScrollMode(Scroll.AUTOY);
west.add(this.expPanel);
north.addListener(Events.Resize, new Listener<BoxComponentEvent>(){
@ -186,6 +199,7 @@ public class GxtBorderLayoutPanel extends ContentPanel {
expPanel.getSmartFolderPanel().setSizeSmartPanel(expPanel.getWidth()-2, expPanel.getHeight()-29);
}
});
add(north, northData);
add(west, westData);

View File

@ -1,5 +1,6 @@
.x-menubar {
background: #FFF url(images/bg-pattern.png) repeat;
background-color: #d0def0;
background-image: none !important;
}
.x-panel-body-noheader {
@ -19,13 +20,14 @@
}
.x-panel-header {
background: #FFF url(images/bg-pattern.png) repeat !important;
background-color: #d0def0;
background-image: none !important;
}
.x-toolbar .xtb-sep {
background-image: none !important;
background-color: transparent;
margin: -2px;
background-image: none !important;
background-color: transparent;
margin: -2px;
}
.x-accordion-hd {
@ -37,7 +39,7 @@
font-weight: bold !important;
}
.x-status-text-panel {
.x-status-text-panel {
border-color: transparent;
}
@ -45,11 +47,10 @@
color: #226599;
}
.x-btn button {
.x-btn button {
color: #226599;
}
.ext-el-mask-msg {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
@ -62,4 +63,4 @@
.ext-el-mask-msg div {
border-color: transparent;
background-color: transparent;
}
}

View File

@ -8,21 +8,6 @@
#SearchAndFilter {
background-color: #d0def0;
/* Mozilla Firefox */
/* background-image: -moz-linear-gradient(top, #DFEAF8 0%, #d0def0 100%); */
/* /* Webkit (Safari/Chrome 10) */
*/
/* background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #DFEAF8), */
/* color-stop(1, #d0def0)); */
/* /* Webkit (Chrome 11+) */
*/
/* background-image: -webkit-linear-gradient(top, #DFEAF8 0%, #d0def0 100%); */
/* /* W3C Markup, IE10 Release Preview */
*/
/* background-image: linear-gradient(to bottom, #DFEAF8 0%, #d0def0 100%); */
/* /* IE10 Consumer Preview */
*/
/* background-image: -ms-linear-gradient(top, #DFEAF8 0%, #d0def0 100%); */
}
#VerticalPanelSearchAndFilter table {