Skip to content

Commit

Permalink
🐛 hide full screen button when not useful
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann committed Dec 13, 2024
1 parent f319d16 commit cccf763
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 cccf763

Please sign in to comment.