Skip to content

Commit

Permalink
Need to set width of timeline correctly for #16
Browse files Browse the repository at this point in the history
  • Loading branch information
kingfisher13 committed Apr 12, 2016
1 parent fbce469 commit 1dc963c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion js/timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ var months = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov",
var scrollInterval;
function buildTimeline(){
$( "#bottom" ).append( "<div id='scroll-left'/>" ).append( "<div id='scroll-right'/>" )
var timeline = $( "<div id='timeline'></div>" ).width( 10 + 9*(dateRange[1] - dateRange[0])/86400000 ),

var pointerCoarse = window.matchMedia("(pointer: coarse)");
var dayWidth = pointerCoarse.matches ? 20 : 9;

var timeline = $( "<div id='timeline'></div>" ).width( 10 + dayWidth*(dateRange[1] - dateRange[0])/86400000 ),
track = $( "<div id='track'></div>" ).css( "width", "100%" ),
month;
$( "#bottom" ).append( $( "<div id='timeline-container'>" ).append( timeline.append(track) ) );
Expand Down

0 comments on commit 1dc963c

Please sign in to comment.