Merge pull request #1923 from grypho/master
Bugfix: #1922 Unintended horizontal shift between Gantt and Resource view
This commit is contained in:
commit
53a98263f8
2 changed files with 11 additions and 2 deletions
7
ganttzk/src/main/java/org/zkoss/ganttz/Planner.java
Normal file → Executable file
7
ganttzk/src/main/java/org/zkoss/ganttz/Planner.java
Normal file → Executable file
|
|
@ -620,7 +620,12 @@ public class Planner extends HtmlMacroComponent {
|
|||
|
||||
westContainer.addEventListener(
|
||||
Events.ON_SIZE,
|
||||
event -> Clients.evalJavaScript("ganttz.TaskList.getInstance().legendResize();"));
|
||||
event -> Clients.evalJavaScript("ganttz.TaskList.getInstance().legendResize();")
|
||||
);
|
||||
|
||||
// Force layout resize after composition. Otherwise the legend will be
|
||||
// too small and the chart will be out of sync to the Gantt diagram.
|
||||
Clients.evalJavaScript("ganttz.TaskList.getInstance().legendResize();");
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
6
ganttzk/src/main/resources/web/js/ganttz/TaskList.js
Normal file → Executable file
6
ganttzk/src/main/resources/web/js/ganttz/TaskList.js
Normal file → Executable file
|
|
@ -29,8 +29,12 @@ ganttz.TaskList = zk.$extends(
|
|||
},
|
||||
|
||||
legendResize : function() {
|
||||
console.log("LegendResize");
|
||||
// Calculate width dependant to the preceeding elements. Otherwise
|
||||
// the elements will be horizontally shifted.
|
||||
var taskdetailsContainer = jq('.taskdetailsContainer')[0];
|
||||
jq('.legend-container').width(taskdetailsContainer.clientWidth - 75);
|
||||
var tabControl = jq('.legend-container').closest('.z-tabbox').find('.charts-tabbox');
|
||||
jq('.legend-container').width(taskdetailsContainer.clientWidth - tabControl.width()); // 75px is the width of the tabs on the left
|
||||
},
|
||||
|
||||
refreshTooltips : function() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue