aboutsummaryrefslogtreecommitdiff
path: root/public/javascripts/weekSelector.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/javascripts/weekSelector.js')
-rw-r--r--public/javascripts/weekSelector.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/public/javascripts/weekSelector.js b/public/javascripts/weekSelector.js
index 7ce0d68..2a8bb62 100644
--- a/public/javascripts/weekSelector.js
+++ b/public/javascripts/weekSelector.js
@@ -1,8 +1,6 @@
const EventEmitter = require('events')
-const self = {}
-
-self.events = new EventEmitter()
+const self = new EventEmitter()
self._nodes = {
prevButton: document.querySelectorAll('#week-selector button')[0],
@@ -41,7 +39,7 @@ self.updateCurrentWeek = function () {
} else {
self._nodes.currentWeekText.classList.remove('changed')
}
- self.events.emit('weekChanged', selectedWeekNumber)
+ self.emit('weekChanged', selectedWeekNumber)
}
self._handlePrevButtonClick = function () {