diff options
author | Noah Loomans <noahloomans@gmail.com> | 2016-12-14 11:07:04 +0100 |
---|---|---|
committer | Noah Loomans <noahloomans@gmail.com> | 2016-12-14 11:07:04 +0100 |
commit | 670976458b5375d27dc525f66b8faa3dc78e799b (patch) | |
tree | a90864d2d549efc6a5bce1b4cab99ffb60676f6d /public/javascripts/weekSelector.js | |
parent | cc60c30509e5b084f2b0c01ba22a6e43a446887f (diff) |
extend EventEmitter instaid of property
Diffstat (limited to 'public/javascripts/weekSelector.js')
-rw-r--r-- | public/javascripts/weekSelector.js | 6 |
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 () { |