[timeline,tweaks][xs]: tweak setting of timeline width to be more robust in different circumstances.
This commit is contained in:
5
dist/recline.js
vendored
5
dist/recline.js
vendored
@@ -2816,7 +2816,10 @@ my.Timeline = Backbone.View.extend({
|
|||||||
_initTimeline: function() {
|
_initTimeline: function() {
|
||||||
var $timeline = this.el.find(this.elementId);
|
var $timeline = this.el.find(this.elementId);
|
||||||
// set width explicitly o/w timeline goes wider that screen for some reason
|
// set width explicitly o/w timeline goes wider that screen for some reason
|
||||||
$timeline.width(this.el.parent().width());
|
var width = Math.max(this.el.width(), this.el.find('.recline-timeline').width());
|
||||||
|
if (width) {
|
||||||
|
$timeline.width(width);
|
||||||
|
}
|
||||||
var config = {};
|
var config = {};
|
||||||
var data = this._timelineJSON();
|
var data = this._timelineJSON();
|
||||||
this.timeline.init(data, this.elementId, config);
|
this.timeline.init(data, this.elementId, config);
|
||||||
|
|||||||
@@ -65,7 +65,10 @@ my.Timeline = Backbone.View.extend({
|
|||||||
_initTimeline: function() {
|
_initTimeline: function() {
|
||||||
var $timeline = this.el.find(this.elementId);
|
var $timeline = this.el.find(this.elementId);
|
||||||
// set width explicitly o/w timeline goes wider that screen for some reason
|
// set width explicitly o/w timeline goes wider that screen for some reason
|
||||||
$timeline.width(this.el.parent().width());
|
var width = Math.max(this.el.width(), this.el.find('.recline-timeline').width());
|
||||||
|
if (width) {
|
||||||
|
$timeline.width(width);
|
||||||
|
}
|
||||||
var config = {};
|
var config = {};
|
||||||
var data = this._timelineJSON();
|
var data = this._timelineJSON();
|
||||||
this.timeline.init(data, this.elementId, config);
|
this.timeline.init(data, this.elementId, config);
|
||||||
|
|||||||
Reference in New Issue
Block a user