Skip to content

Commit

Permalink
🐛 hide full screen button when not useful (#4305)
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann authored Dec 13, 2024
1 parent f319d16 commit 5a48228
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/@ourworldindata/grapher/src/core/Grapher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2419,9 +2419,10 @@ export class Grapher
}

@computed get hideFullScreenButton(): boolean {
const { windowInnerHeight } = this
if (!windowInnerHeight) return true
return this.windowInnerHeight! < this.frameBounds.height
// hide the full screen button if the full screen height
// is barely larger than the current chart height
const fullScreenHeight = this.windowInnerHeight!
return fullScreenHeight < this.frameBounds.height + 80
}

@computed private get availableWidth(): number {
Expand Down

0 comments on commit 5a48228

Please sign in to comment.