From c030ab5df27ac08a01deb82950a94df7b129fd07 Mon Sep 17 00:00:00 2001 From: Konstantin Varlamov Date: Wed, 9 Jan 2019 15:50:11 +0300 Subject: [PATCH 1/2] bug-fix: Groups height newer decreases --- lib/timeline/component/Group.js | 8 ++++---- lib/timeline/optionsTimeline.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/timeline/component/Group.js b/lib/timeline/component/Group.js index d978479..f6db6cf 100644 --- a/lib/timeline/component/Group.js +++ b/lib/timeline/component/Group.js @@ -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; } diff --git a/lib/timeline/optionsTimeline.js b/lib/timeline/optionsTimeline.js index 318302d..3a4e300 100644 --- a/lib/timeline/optionsTimeline.js +++ b/lib/timeline/optionsTimeline.js @@ -223,7 +223,7 @@ let configureOptions = { year: '' } }, - groupHeightMode: ['auto', 'fixed'], + groupHeightMode: ['auto', 'fixed', 'fitItems'], //groupOrder: {string, 'function': 'function'}, groupsDraggable: false, height: '', From fd93cd047c3f4a3c3e60ff8380772c8b66372f32 Mon Sep 17 00:00:00 2001 From: "konsvarl.work" Date: Tue, 15 Jan 2019 21:02:22 +0300 Subject: [PATCH 2/2] chore: add options documentation --- docs/src/OptionsPage.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/src/OptionsPage.js b/docs/src/OptionsPage.js index 942b83f..9a1dc43 100644 --- a/docs/src/OptionsPage.js +++ b/docs/src/OptionsPage.js @@ -222,7 +222,12 @@ class OptionsPage extends React.Component { groupHeightMode String 'auto' - 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. + + Specifies how the height of a group is calculated. Choose from 'auto','fixed', and 'fitItems'.
+ If it is set to 'auto' the height will be calculated based on a group label and visible items.
+ If it is set to 'fitItems' the height will be calculated based on the visible items only.
+ While if it is set to 'fixed' the group will keep the same height even if there are no visible items in the window. +