Skip to content

Commit

Permalink
Only consider embedded if one of preview or hint is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Feb 6, 2025
1 parent 2986c5d commit 57d6fc8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
9 changes: 4 additions & 5 deletions assets/js/globals.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
const params = new URLSearchParams(window.location.search)
const isFrame = window.self !== window.parent

export const isEmbedded = window.self !== window.parent

export const isPreview = params.has('preview')

export const isHint = params.has('hint')
export const isPreview = isFrame && params.has('preview')
export const isHint = isFrame && params.has('hint')
export const isEmbedded = isPreview || isHint

// These variables are set by other scripts (e.g. generated by the docs task).

Expand Down
Loading

0 comments on commit 57d6fc8

Please sign in to comment.