Skip to content

Commit

Permalink
fix(grapher): open sources modal when embedded
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann committed Nov 7, 2023
1 parent bc32df2 commit 1eacfe0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/@ourworldindata/grapher/src/footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,12 @@ export class Footer<
className="learn-more-about-data"
data-track-note="chart_click_sources"
onClick={action(() => {
// if embbedded, open the sources modal
if (this.manager.isEmbeddedInAnOwidPage) {
this.manager.isSourcesModalOpen = true
return
}

// on data pages, scroll to the "Sources and Processing" section
// on grapher pages, open the sources modal
const sourcesIdOnDataPage =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ export interface FooterManager extends TooltipManager, ActionButtonsManager {
isGeneratingThumbnail?: boolean
fontSize?: number
isInFullScreenMode?: boolean
isEmbeddedInAnOwidPage?: boolean
}

0 comments on commit 1eacfe0

Please sign in to comment.