aboutsummaryrefslogtreecommitdiff
path: root/public/javascripts/main.js
blob: 6e0796c021dccd32c4819de69c96991d720191db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const frontpage = require('./frontpage')
const search = require('./search')
const schedule = require('./schedule')
const weekSelector = require('./weekSelector')

const state = {}

frontpage.show()
weekSelector.updateCurrentWeek()

search.on('search', function (selectedItem) {
  state.selectedItem = selectedItem
  schedule.viewItem(weekSelector.getSelectedWeek(), state.selectedItem)
})

weekSelector.on('weekChanged', function (newWeek) {
  schedule.viewItem(newWeek, state.selectedItem)
})

window.weekSelector = weekSelector

document.body.style.opacity = 1