aboutsummaryrefslogtreecommitdiff
path: root/public/javascripts/main.js
blob: bd28475d3e52a8f11f141fd833e466997c28e359 (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.events.on('search', function (selectedItem) {
  state.selectedItem = selectedItem
  schedule.viewItem(weekSelector.getSelectedWeek(), state.selectedItem)
})

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

window.weekSelector = weekSelector

document.body.style.opacity = 1