|
@ -218,14 +218,22 @@ Core.prototype.setOptions = function (options) { |
|
|
|
|
|
|
|
|
if ('orientation' in options) { |
|
|
if ('orientation' in options) { |
|
|
if (typeof options.orientation === 'string') { |
|
|
if (typeof options.orientation === 'string') { |
|
|
this.options.orientation = options.orientation; |
|
|
|
|
|
|
|
|
this.options.orientation = { |
|
|
|
|
|
item: options.orientation, |
|
|
|
|
|
axis: options.orientation |
|
|
|
|
|
}; |
|
|
} |
|
|
} |
|
|
else if (typeof options.orientation === 'object' && 'axis' in options.orientation) { |
|
|
|
|
|
this.options.orientation = options.orientation.axis; |
|
|
|
|
|
|
|
|
else if (typeof options.orientation === 'object') { |
|
|
|
|
|
if ('item' in options.orientation) { |
|
|
|
|
|
this.options.orientation.item = options.orientation.item; |
|
|
|
|
|
} |
|
|
|
|
|
if ('axis' in options.orientation) { |
|
|
|
|
|
this.options.orientation.axis = options.orientation.axis; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (this.options.orientation === 'both') { |
|
|
|
|
|
|
|
|
if (this.options.orientation.axis === 'both') { |
|
|
if (!this.timeAxis2) { |
|
|
if (!this.timeAxis2) { |
|
|
var timeAxis2 = this.timeAxis2 = new TimeAxis(this.body); |
|
|
var timeAxis2 = this.timeAxis2 = new TimeAxis(this.body); |
|
|
timeAxis2.setOptions = function (options) { |
|
|
timeAxis2.setOptions = function (options) { |
|
@ -680,7 +688,7 @@ Core.prototype._redraw = function() { |
|
|
|
|
|
|
|
|
// reposition the scrollable contents
|
|
|
// reposition the scrollable contents
|
|
|
var offset = this.props.scrollTop; |
|
|
var offset = this.props.scrollTop; |
|
|
if (options.orientation == 'bottom') { |
|
|
|
|
|
|
|
|
if (options.orientation.item == 'bottom') { |
|
|
offset += Math.max(this.props.centerContainer.height - this.props.center.height - |
|
|
offset += Math.max(this.props.centerContainer.height - this.props.center.height - |
|
|
this.props.border.top - this.props.border.bottom, 0); |
|
|
this.props.border.top - this.props.border.bottom, 0); |
|
|
} |
|
|
} |
|
@ -936,7 +944,7 @@ Core.prototype._updateScrollTop = function () { |
|
|
if (scrollTopMin != this.props.scrollTopMin) { |
|
|
if (scrollTopMin != this.props.scrollTopMin) { |
|
|
// in case of bottom orientation, change the scrollTop such that the contents
|
|
|
// in case of bottom orientation, change the scrollTop such that the contents
|
|
|
// do not move relative to the time axis at the bottom
|
|
|
// do not move relative to the time axis at the bottom
|
|
|
if (this.options.orientation == 'bottom') { |
|
|
|
|
|
|
|
|
if (this.options.orientation.item == 'bottom') { |
|
|
this.props.scrollTop += (scrollTopMin - this.props.scrollTopMin); |
|
|
this.props.scrollTop += (scrollTopMin - this.props.scrollTopMin); |
|
|
} |
|
|
} |
|
|
this.props.scrollTopMin = scrollTopMin; |
|
|
this.props.scrollTopMin = scrollTopMin; |
|
|