[timeline,tweaks][xs]: tweak setting of timeline width to be more robust in different circumstances.

This commit is contained in:
Rufus Pollock 2012-06-10 21:08:29 +01:00
parent 80d3576a6c
commit 399172b8f4
2 changed files with 8 additions and 2 deletions

5
dist/recline.js vendored
View File

@ -2816,7 +2816,10 @@ my.Timeline = Backbone.View.extend({
_initTimeline: function() {
var $timeline = this.el.find(this.elementId);
// 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 data = this._timelineJSON();
this.timeline.init(data, this.elementId, config);

View File

@ -65,7 +65,10 @@ my.Timeline = Backbone.View.extend({
_initTimeline: function() {
var $timeline = this.el.find(this.elementId);
// 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 data = this._timelineJSON();
this.timeline.init(data, this.elementId, config);