[Bug #820] Several changes in watermark height calculations
Fixed bug and aded some modifications to the system to calculate watermark heigth. An enhancement to this could be calling ganttz.Planner.getInstance().adjustScrollableDimensions() also on window resizes to avoid the appearance of a white area when increasing the backport and before a recalculation is called. FEA: ItEr75S04BugFixing
This commit is contained in:
parent
abd2092fad
commit
82425deed5
5 changed files with 11 additions and 30 deletions
|
|
@ -196,7 +196,7 @@ public class GanttPanel extends XulElement implements AfterCompose {
|
|||
}
|
||||
|
||||
public void adjustZoomColumnsHeight() {
|
||||
response("adjust_height", new AuInvoke(this, "adjust_height"));
|
||||
response("adjust_dimensions", new AuInvoke(this, "adjust_dimensions"));
|
||||
}
|
||||
|
||||
public LocalDate getPreviousStart() {
|
||||
|
|
|
|||
|
|
@ -791,6 +791,7 @@ public class Planner extends HtmlMacroComponent {
|
|||
setTaskListPredicate(predicate);
|
||||
}
|
||||
isFlattenTree = !isFlattenTree;
|
||||
Clients.evalJavaScript("ganttz.Planner.getInstance().adjustScrollableDimensions()");
|
||||
}
|
||||
|
||||
public FilterAndParentExpandedPredicates getPredicate() {
|
||||
|
|
|
|||
|
|
@ -61,8 +61,6 @@ import org.zkoss.zul.impl.XulElement;
|
|||
*/
|
||||
public class TaskList extends XulElement implements AfterCompose {
|
||||
|
||||
private static final int HEIGHT_PER_ROW = 20; /* 30 */
|
||||
|
||||
private transient IZoomLevelChangedListener zoomLevelChangedListener;
|
||||
|
||||
private List<Task> currentTotalTasks;
|
||||
|
|
@ -142,7 +140,6 @@ public class TaskList extends XulElement implements AfterCompose {
|
|||
addListenerForTaskComponentEditForm(taskComponent);
|
||||
taskComponent.afterCompose();
|
||||
if (relocate) {
|
||||
setHeight(getHeight());// forcing smart update
|
||||
getGanttPanel().adjustZoomColumnsHeight();
|
||||
getGanttPanel().getDependencyList().redrawDependencies();
|
||||
}
|
||||
|
|
@ -189,11 +186,6 @@ public class TaskList extends XulElement implements AfterCompose {
|
|||
taskComponent.setContext(getContextMenuFor(taskComponent));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHeight() {
|
||||
return getTasksNumber() * HEIGHT_PER_ROW + "px";
|
||||
}
|
||||
|
||||
private TimeTrackerComponent getTimeTrackerComponent() {
|
||||
return getGanttPanel().getTimeTrackerComponent();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,8 +33,7 @@ ganttz.GanttPanel = zk.$extends(zk.Widget,{
|
|||
jq(element).css("left", "-" + this._rightpannellayout.scrollLeft() + "px")
|
||||
}, this));
|
||||
},
|
||||
adjust_height : function(){
|
||||
jq(this.$n()).height(jq('#scroll_container').height());
|
||||
adjust_dimensions : function(){
|
||||
ganttz.Planner.getInstance().adjustScrollableDimensions();
|
||||
},
|
||||
_calcXY : function(event){
|
||||
|
|
|
|||
|
|
@ -35,19 +35,9 @@ ganttz.Planner = zk.$extends(zk.Macro,{
|
|||
DOMTimetracker.width(DOMScrollContainer.innerWidth());
|
||||
DOMTimetracker.height(
|
||||
Math.max(
|
||||
jq(window).height() -
|
||||
this.$class.TIMETRACKER_OFFSET_TOP +
|
||||
26),
|
||||
(
|
||||
jq('#listdetails_container').height() +
|
||||
12));
|
||||
|
||||
DOMScrollContainer.height(
|
||||
jq(window).height() -
|
||||
this.$class.TIMETRACKER_OFFSET_TOP -
|
||||
this.$class.FOOTER_HEIGHT +
|
||||
this.$class.SCROLLBAR_WIDTH * 2);
|
||||
|
||||
jq(window).height() - this.$class.UNSCROLLABLE_AREA,
|
||||
jq('#scroll_container').height() + this.$class.BOTTOM_WATERMARK_PADDING
|
||||
));
|
||||
|
||||
// Inner divs need recalculation to adjust to new scroll displacement lenght
|
||||
ganttz.GanttPanel.getInstance().reScrollY(jq('#listdetails_container').height());
|
||||
|
|
@ -61,15 +51,14 @@ ganttz.Planner = zk.$extends(zk.Macro,{
|
|||
zAu.send(new zk.Event(this, 'onZoomLevelChange', {zoomindex : zoomindex, scrollLeft : scrollLeft}));
|
||||
}
|
||||
},{
|
||||
FOOTER_HEIGHT : 40, // Design-relative footer height
|
||||
TIMETRACKER_OFFSET_TOP : 120, // Design-relative height above timetracker
|
||||
TASKDETAILS_WIDTH : 300, // Taskdetails column fixed width (300)
|
||||
TASKDETAILS_HEIGHT : 180, // 260 // Design-relative reservated height for taskdetails (300,260)
|
||||
SCROLLBAR_WIDTH : 15, // Scrollbars default width
|
||||
TASKDETAILS_WIDTH : 300, // Taskdetails column fixed width (300)
|
||||
UNSCROLLABLE_AREA : 170, // Design-relative reservated height for taskdetails (300,260)
|
||||
SCROLLBAR_WIDTH : 15, // Scrollbars default width
|
||||
BOTTOM_WATERMARK_PADDING : 40, // Space left behind last task
|
||||
getInstance : function(){
|
||||
return this._instance;
|
||||
},
|
||||
setInstance : function(instance){
|
||||
this._instance = instance;
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue