diff options
Diffstat (limited to 'public/javascripts/main.js')
-rw-r--r-- | public/javascripts/main.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/public/javascripts/main.js b/public/javascripts/main.js index 7d2c8bb..5ebeb7b 100644 --- a/public/javascripts/main.js +++ b/public/javascripts/main.js @@ -4,6 +4,7 @@ const schedule = require('./schedule') const weekSelector = require('./weekSelector') const favorite = require('./favorite') const scrollSnap = require('./scrollSnap') +const analytics = require('./analytics') const state = {} @@ -17,6 +18,7 @@ scrollSnap.startListening() if (favorite.get() != null) { state.selectedItem = favorite.get() favorite.update(state.selectedItem) + analytics.send.search(state.selectedItem, true) schedule.viewItem(weekSelector.getSelectedWeek(), state.selectedItem) } else { search.focus() @@ -25,10 +27,12 @@ if (favorite.get() != null) { search.on('search', function (selectedItem) { state.selectedItem = selectedItem favorite.update(state.selectedItem) + analytics.send.search(state.selectedItem) schedule.viewItem(weekSelector.getSelectedWeek(), state.selectedItem) }) weekSelector.on('weekChanged', function (newWeek) { + analytics.send.search(state.selectedItem) schedule.viewItem(newWeek, state.selectedItem) }) |