aboutsummaryrefslogtreecommitdiff
path: root/public/javascripts/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/javascripts/main.js')
-rw-r--r--public/javascripts/main.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/public/javascripts/main.js b/public/javascripts/main.js
index 29f1d3e..bd28475 100644
--- a/public/javascripts/main.js
+++ b/public/javascripts/main.js
@@ -1,11 +1,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) {
- schedule.viewItem(0, 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