DEV: Safari's window.innerWidth doesn't match CSS

This commit is contained in:
awesomerobot 2022-03-31 21:25:06 -04:00 committed by Alan Guo Xiang Tan
parent e54440a035
commit 98f3349c31
1 changed files with 6 additions and 1 deletions

View File

@ -45,6 +45,11 @@ export default Component.extend(PanEvents, {
let info = this.info; let info = this.info;
// Safari's window.innerWidth doesn't match CSS media queries
let windowWidth = this.capabilities.isSafari
? document.documentElement.clientWidth
: window.innerWidth;
if (info.get("topicProgressExpanded")) { if (info.get("topicProgressExpanded")) {
info.set("renderTimeline", true); info.set("renderTimeline", true);
} else { } else {
@ -55,7 +60,7 @@ export default Component.extend(PanEvents, {
if (composer) { if (composer) {
renderTimeline = renderTimeline =
window.innerWidth > MIN_WIDTH_TIMELINE && windowWidth > MIN_WIDTH_TIMELINE &&
window.innerHeight - composer.offsetHeight - headerOffset() > window.innerHeight - composer.offsetHeight - headerOffset() >
MIN_HEIGHT_TIMELINE; MIN_HEIGHT_TIMELINE;
} }