Detect touch device and seporate window.resize and window.onrintationchange