File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -1390,12 +1390,14 @@ Docs at http://horizontal-timeline.ycodetech.co.uk
13901390 // Get the css left value of the last event date, remove the px unit and add 100 to it.
13911391 lastEventLeft = Number ( timelineComponents [ 'timelineEvents' ] . last ( ) . css ( 'left' ) . replace ( 'px' , '' ) ) + 100 ;
13921392
1393- // Set the timeline width
1394- totalWidth = lastEventLeft ;
1395-
1396- // Set a fail-safe, if totalWidth is less than the wrapperWidth then use the wrapperWidth as width.
1393+ // Set a fail-safe, if lastEventLeft is less than the wrapperWidth then use the wrapperWidth as totalWidth.
13971394 // Stops the timeline width from being too small.
1398- if ( totalWidth < wrapperWidth ) totalWidth = wrapperWidth ;
1395+ if ( lastEventLeft < wrapperWidth ) {
1396+ totalWidth = wrapperWidth ;
1397+ }
1398+ else {
1399+ totalWidth = lastEventLeft ;
1400+ }
13991401
14001402 timelineComponents [ 'eventsWrapper' ] . css ( 'width' , totalWidth + 'px' ) ;
14011403 this . _updateTimelinePosition ( timelineComponents [ 'eventsWrapper' ] . find ( 'a.selected' ) , timelineComponents , totalWidth ) ;
You can’t perform that action at this time.
0 commit comments