diff --git a/js/level2.js b/js/level2.js index 7b88e97..c234b4d 100644 --- a/js/level2.js +++ b/js/level2.js @@ -74,6 +74,8 @@ function refreshContent() { timeDifference = busTime.diff( now, 'minutes' ); + timeLeftMessage = 'departure in ' + timeDifference + 'minutes'; + if ( timeDifference <= 5 ) { labelColor = "danger"; @@ -85,10 +87,11 @@ function refreshContent() { } else { labelColor = "info"; + timeLeftMessage = ''; } - content += '

' + time + ' ' + name + '

' + destination; + content += '

' + time + ' ' + name + ' ' + destination + '

' + timeLeftMessage; });