aboutsummaryrefslogtreecommitdiff
path: root/public/javascripts/weekSelector.js
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2017-01-27 16:10:56 +0100
committerNoah Loomans <noahloomans@gmail.com>2017-01-27 16:10:56 +0100
commita3aba8bb9fde8c4851ef8af46f571e64995be3cc (patch)
tree87d87417e3cf20bb79d0987710aa0355e2f72551 /public/javascripts/weekSelector.js
parent696f15f0994533793d3ad7b534ff1555db2a392e (diff)
Fix print support
Signed-off-by: Noah Loomans <noahloomans@gmail.com>
Diffstat (limited to 'public/javascripts/weekSelector.js')
-rw-r--r--public/javascripts/weekSelector.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/public/javascripts/weekSelector.js b/public/javascripts/weekSelector.js
index 6dbf2c8..d4e7f2a 100644
--- a/public/javascripts/weekSelector.js
+++ b/public/javascripts/weekSelector.js
@@ -5,7 +5,9 @@ const self = new EventEmitter()
self._nodes = {
prevButton: document.querySelectorAll('#week-selector button')[0],
nextButton: document.querySelectorAll('#week-selector button')[1],
- currentWeekText: document.querySelector('#week-selector .current')
+ currentWeekNode: document.querySelector('#week-selector .current'),
+ currentWeekNormalText: document.querySelector('#week-selector .current .no-print'),
+ currentWeekPrintText: document.querySelector('#week-selector .current .print')
}
self._weekOffset = 0
@@ -35,9 +37,9 @@ self.getSelectedWeek = function () {
self.updateCurrentWeek = function () {
const selectedWeekNumber = self.getSelectedWeek()
if (self.getCurrentWeek(new Date()) !== selectedWeekNumber) {
- self._nodes.currentWeekText.classList.add('changed')
+ self._nodes.currentWeekNode.classList.add('changed')
} else {
- self._nodes.currentWeekText.classList.remove('changed')
+ self._nodes.currentWeekNode.classList.remove('changed')
}
self.updateDom()
self.emit('weekChanged', selectedWeekNumber)
@@ -73,9 +75,11 @@ self.updateDom = function () {
}
}
if (humanReadableWeek != null) {
- self._nodes.currentWeekText.textContent = humanReadableWeek + ' • ' + selectedWeekNumber
+ self._nodes.currentWeekNormalText.textContent = humanReadableWeek + ' • ' + selectedWeekNumber
+ self._nodes.currentWeekPrintText.textContent = 'Week ' + selectedWeekNumber
} else {
- self._nodes.currentWeekText.textContent = 'Week ' + selectedWeekNumber
+ self._nodes.currentWeekNormalText.textContent = 'Week ' + selectedWeekNumber
+ self._nodes.currentWeekPrintText.textContent = 'Week ' + selectedWeekNumber
}
}