diff --git a/src/bar.js b/src/bar.js index a8d4cec..95b351d 100644 --- a/src/bar.js +++ b/src/bar.js @@ -340,9 +340,11 @@ export default class Bar { return; } this.update_attr(bar, "x", x); + this.update_attr(this.$date_highlight, "x", x); } if (width) { this.update_attr(bar, "width", width); + this.update_attr(this.$date_highlight, "width", width); } this.update_label_position(); this.update_handle_position(); diff --git a/src/index.js b/src/index.js index a1f1816..2c3e2fc 100644 --- a/src/index.js +++ b/src/index.js @@ -101,7 +101,8 @@ export default class Gantt { readonly: false, highlight_weekend: true, scroll_today: true, - lines: 'both' + lines: 'both', + auto_move_label: true, }; this.options = Object.assign({}, default_options, options); if (!options.view_mode_padding) options.view_mode_padding = {} @@ -854,10 +855,11 @@ export default class Gantt { if (dx) { localBars = ids.map(id => this.get_bar(id)); - - localBars.forEach(bar => { - bar.update_label_position_on_horizontal_scroll({ x: dx, sx: e.currentTarget.scrollLeft }); - }); + if (this.options.auto_move_label) { + localBars.forEach(bar => { + bar.update_label_position_on_horizontal_scroll({ x: dx, sx: e.currentTarget.scrollLeft }); + }); + } } x_on_scroll_start = e.currentTarget.scrollLeft;