summaryrefslogtreecommitdiffstats
path: root/web/react/utils/utils.jsx
diff options
context:
space:
mode:
authorAntti Ahti <antti.ahti@gmail.com>2015-10-16 12:32:19 +0300
committerAntti Ahti <antti.ahti@gmail.com>2015-10-20 10:07:45 +0300
commitd3f99e821733b7c86ad297c136489678a2a9fffb (patch)
tree2e6451df65b9b2373ca7af33020c7c9b9aec367d /web/react/utils/utils.jsx
parent4404912909d1ce445e5d80fb622f7d9fe91ff78d (diff)
downloadchat-d3f99e821733b7c86ad297c136489678a2a9fffb.tar.gz
chat-d3f99e821733b7c86ad297c136489678a2a9fffb.tar.bz2
chat-d3f99e821733b7c86ad297c136489678a2a9fffb.zip
Handle window resize events in React way
Use the React-way of handling resize events. Essentially store the window size in component state instead of doing some custom handling. See http://facebook.github.io/react/tips/dom-event-listeners.html
Diffstat (limited to 'web/react/utils/utils.jsx')
-rw-r--r--web/react/utils/utils.jsx8
1 files changed, 8 insertions, 0 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index fb0690d66..5f266bba3 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -968,3 +968,11 @@ export function getShortenedTeamURL() {
}
return teamURL + '/';
}
+
+export function windowWidth() {
+ return $(window).width();
+}
+
+export function windowHeight() {
+ return $(window).height();
+}