aboutsummaryrefslogtreecommitdiff
path: root/src/client/javascript/zoom.js
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2017-12-10 00:22:36 +0100
committerNoah Loomans <noahloomans@gmail.com>2017-12-10 00:22:36 +0100
commit503f94199f7fc730da4a1a1165c2863956d10000 (patch)
tree035e47f4a734a6c9b9649e77333ed49dce4ac710 /src/client/javascript/zoom.js
parentf18692872cdc28d29917247ef4f8ef7553a8b023 (diff)
Setup react-redux env
Diffstat (limited to 'src/client/javascript/zoom.js')
-rw-r--r--src/client/javascript/zoom.js30
1 files changed, 0 insertions, 30 deletions
diff --git a/src/client/javascript/zoom.js b/src/client/javascript/zoom.js
deleted file mode 100644
index 59b80db..0000000
--- a/src/client/javascript/zoom.js
+++ /dev/null
@@ -1,30 +0,0 @@
-const schedule = require('./schedule')
-
-const self = {}
-
-self._nodes = {
- body: document.body
-}
-
-self._handleResize = function () {
- // the table node may not exist before this function is called
- const tableNode = document.querySelector('center > table')
-
- // infact, it may not even exist when this function is called.
- if (!tableNode) return
-
- const tableWidth = tableNode.getBoundingClientRect().width
- const tableGoalWidth = self._nodes.body.getBoundingClientRect().width * 0.9
- const zoomFactor = tableGoalWidth / tableWidth
-
- if (zoomFactor < 1) {
- tableNode.style.zoom = `${zoomFactor}`
- } else {
- tableNode.style.zoom = `1`
- }
-}
-
-schedule.on('load', self._handleResize)
-window.addEventListener('resize', self._handleResize)
-
-module.exports = self