Skip to content
This repository has been archived by the owner on Nov 19, 2019. It is now read-only.

Commit

Permalink
Merge pull request #92 from konsvarl/bug-fix/fix-group-height
Browse files Browse the repository at this point in the history
Fix:  groups height never decreases (#91)
  • Loading branch information
yotamberk authored Jan 18, 2019
2 parents c2572b5 + fd93cd0 commit a73a03e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
7 changes: 6 additions & 1 deletion docs/src/OptionsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,12 @@ class OptionsPage extends React.Component {
<td>groupHeightMode</td>
<td>String</td>
<td>'auto'</td>
<td>Specifies how the height of a group is calculated. Choose from 'auto' and 'fixed'. If it is set to 'auto' the height will be calculated based on the visible items. While if it is set to 'fixed' the group will keep the same height even if there are no visible items in the window.</td>
<td>
Specifies how the height of a group is calculated. Choose from 'auto','fixed', and 'fitItems'. <br />
If it is set to 'auto' the height will be calculated based on a group label and visible items.<br />
If it is set to 'fitItems' the height will be calculated based on the visible items only.<br />
While if it is set to 'fixed' the group will keep the same height even if there are no visible items in the window.
</td>
</tr>

<tr>
Expand Down
8 changes: 4 additions & 4 deletions lib/timeline/component/Group.js
Original file line number Diff line number Diff line change
Expand Up @@ -574,13 +574,13 @@ class Group {
});
}
height = max + margin.item.vertical / 2;
if (this.heightMode !== "fitItems") {
height = Math.max(height, this.props.label.height);
}
}
else {
height = 0;
height = 0 || this.props.label.height;
}

height = Math.max(height, this.props.label.height);

return height;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/timeline/optionsTimeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ let configureOptions = {
year: ''
}
},
groupHeightMode: ['auto', 'fixed'],
groupHeightMode: ['auto', 'fixed', 'fitItems'],
//groupOrder: {string, 'function': 'function'},
groupsDraggable: false,
height: '',
Expand Down

0 comments on commit a73a03e

Please sign in to comment.