ItEr58S04ValidacionEProbasFuncionaisItEr57S04: Fixing bug. Vertical resize of watermarks in resourcesload list

This commit is contained in:
Lorenzo Tilve 2010-05-17 10:32:55 +02:00 committed by Javier Moran Rua
parent ff0be47358
commit 5fa194ebb6
5 changed files with 31 additions and 14 deletions

View file

@ -36,6 +36,7 @@ import org.zkoss.zk.au.out.AuInvoke;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.HtmlMacroComponent;
import org.zkoss.zk.ui.ext.AfterCompose;
import org.zkoss.zk.ui.util.Clients;
/**
* Component to include a list of ResourceLoads inside the ResourcesLoadPanel.
@ -98,6 +99,8 @@ public class ResourceLoadList extends HtmlMacroComponent implements
for (LoadTimeLine l : line.getAllChildren()) {
getComponentFor(l).detach();
}
Clients
.evalJavaScript("zkResourcesLoadList.recalculateTimetrackerHeight();");
}
private ResourceLoadComponent getComponentFor(LoadTimeLine l) {
@ -118,7 +121,8 @@ public class ResourceLoadList extends HtmlMacroComponent implements
insertBefore(child, nextSibling);
nextSibling = child;
}
Clients
.evalJavaScript("zkResourcesLoadList.recalculateTimetrackerHeight();");
}
private List<LoadTimeLine> getChildrenReverseOrderFor(LoadTimeLine line) {

View file

@ -60,7 +60,7 @@ resourcesLoadPanel = self;
splittable="true" autoscroll="true">
<borderlayout >
<north border="0" height="38px" flex="true" collapsible="true">
<north border="0" height="35px" flex="true" collapsible="true">
<vbox pack="top" align="center">
<tree fixedLayout="true">
<treecols>
@ -78,7 +78,7 @@ resourcesLoadPanel = self;
<center sclass="taskspanel">
<borderlayout>
<north border="0"><div sclass="timetrackergap" height="33px" id="insertionPointTimetracker"></div></north>
<north border="0"><div sclass="timetrackergap" height="30px" id="insertionPointTimetracker"></div></north>
<center autoscroll="true" border="0" sclass="rightpanellayout">
<div id="insertionPointRightPanel" sclass="taskspanelgap"></div>
</center>

View file

@ -20,6 +20,24 @@
zkResourcesLoadList = addResourcesLoadListMethods( {});
zkResourcesLoadList.WATERMARK_MIN_HEIGHT = 450;
zkResourcesLoadList.WATERMARK_MARGIN_BOTTOM = 40;
function resourceloadlist() {
return YAHOO.util.Selector.query('.resourceloadlist')[0];
}
function firstWatermarkColumn() {
return YAHOO.util.Selector.query('.rightpanellayout tr#watermark td')[0];
}
zkResourcesLoadList.recalculateTimetrackerHeight = function (cmp) {
var height = Math.max(
resourceloadlist().clientHeight + zkResourcesLoadList.WATERMARK_MARGIN_BOTTOM,
zkResourcesLoadList.WATERMARK_MIN_HEIGHT);
firstWatermarkColumn().style.height = height + "px";
}
function addResourcesLoadListMethods(object) {
var scrollSync;
@ -65,12 +83,10 @@ function addResourcesLoadListMethods(object) {
zkResourcesLoadList.adjustTimeTrackerSize, cmp);
scrollSync = new ScrollSync(cmp);
scrollSync.synchXChangeTo(timetracker);
listenToScroll();
};
function listenToScroll() {
var timetrackergap_ = timetrackergap();
var scrolledpannel_ = scrolledpannel();
var resourcesloadgraph_ = resourcesloadgraph();
@ -88,17 +104,14 @@ function addResourcesLoadListMethods(object) {
rightpanel_.onscroll = onScroll;
}
object.adjustTimeTrackerSize = function(cmp) {
zkResourcesLoadList.recalculateTimetrackerHeight();
watermark().style["height"] = cmp.clientHeight + "px";
timetracker().style["width"] = cmp.clientWidth + "px";
/* Set watermark width */
YAHOO.util.Selector.query('.resourceloadlist')[0].style["width"] = YAHOO.util.Selector
.query('.second_level_')[0].clientWidth
+ "px";
YAHOO.util.Selector.query('.rightpanellayout tr#watermark td')[0].style["height"] =
/* Calculate min : taskspanelgap().clientHeight + 120 + 'px'; ) */
YAHOO.util.Selector.query('.resourceloadlist')[0].clientHeight + 120
+ "px";
.query('.second_level_')[0].clientWidth + "px";
};
object.adjustResourceLoadRows = function(cmp) {

View file

@ -78,7 +78,7 @@ resourcesLoadPanel = self;
splittable="true" autoscroll="true">
<borderlayout >
<north border="0" height="38px" flex="true" collapsible="true">
<north border="0" height="35px" flex="true" collapsible="true">
<vbox pack="top" align="center">
<tree fixedLayout="true">
<treecols>
@ -96,7 +96,7 @@ resourcesLoadPanel = self;
<center sclass="taskspanel">
<borderlayout>
<north border="0"><div sclass="timetrackergap" height="33px" id="insertionPointTimetracker"></div></north>
<north border="0"><div sclass="timetrackergap" height="30px" id="insertionPointTimetracker"></div></north>
<center autoscroll="true" border="0" sclass="rightpanellayout">
<div id="insertionPointRightPanel" sclass="taskspanelgap"></div>
</center>

View file

@ -62,7 +62,7 @@
</div>
<window id="editTaskWindow" apply="${editController}" border="normal"
width="870px" visible="false">
width="870px" visible="false" >
<vbox id="messagesContainer" />