Skip to content

Commit

Permalink
changing how to select body
Browse files Browse the repository at this point in the history
  • Loading branch information
bsatarnejad committed Jan 25, 2024
1 parent 6350ae2 commit d5e2933
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/components/primer/open_project/zen_mode_button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ class ZenModeButtonElement extends HTMLElement {
private deactivateZenMode() {
this.inZenMode = false
this.button.classList.remove('zen-mode-button--active')
this.querySelector('body')?.classList.remove('zen-mode')
document.getElementsByTagName('body')[0].classList.remove('zen-mode')
if (screenfull.isEnabled && screenfull.isFullscreen) {
screenfull.exit()
}
}

private activateZenMode() {
this.inZenMode = true
document.querySelector('body')?.classList.add('zen-mode')
document.getElementsByTagName('body')[0].classList.add('zen-mode')
this.button.classList.add('zen-mode-button--active')
if (screenfull.isEnabled) {
screenfull.request()
Expand Down

0 comments on commit d5e2933

Please sign in to comment.