Skip to content

Commit

Permalink
Add enable scrollbar after chart update
Browse files Browse the repository at this point in the history
  • Loading branch information
cosycode authored and TorsteinHonsi committed Jun 4, 2018
1 parent 5e560ea commit 5271654
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions js/parts/Navigator.js
Expand Up @@ -2161,26 +2161,25 @@ addEvent(Chart, 'afterSetChartSize', function () {
// Merge options, if no scrolling exists yet
addEvent(Chart, 'update', function (e) {

var newOptions = (e.options.navigator || {}),
options = (this.options.navigator || {});
var navigatorOptions = (e.options.navigator || {}),
scrollbarOptions = (e.options.scrollbar || {});

if (!this.navigator &&
!this.scroller &&
newOptions.enabled === true
if (!this.navigator && !this.scroller &&
(navigatorOptions.enabled || scrollbarOptions.enabled)
) {
merge(true, options, newOptions);
merge(true, this.options.navigator, navigatorOptions);
merge(true, this.options.scrollbar, scrollbarOptions);
delete e.options.navigator;
delete e.options.scrollbar;
}

});

// Initiate navigator, if no scrolling exists yet
addEvent(Chart, 'afterUpdate', function (e) {
addEvent(Chart, 'afterUpdate', function () {

var newOptions = (e.options.navigator || {});

if (!this.navigator &&
!this.scroller &&
newOptions.enabled === true
if (!this.navigator && !this.scroller &&
(this.options.navigator.enabled || this.options.scrollbar.enabled)
) {
this.scroller = this.navigator = new Navigator(this);
}
Expand Down

0 comments on commit 5271654

Please sign in to comment.