Skip to content

Commit

Permalink
Flyout: don't show the version name if project is single version (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
humitos authored Sep 21, 2023
1 parent 2cc9b0d commit fba6bf4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dist/readthedocs-addons.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/readthedocs-addons.js.map

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion public/_/readthedocs-addons.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"api_version": "0",
"comment": "THIS RESPONSE IS IN ALPHA FOR TEST PURPOSES ONLY AND IT'S GOING TO CHANGE COMPLETELY -- DO NOT USE IT!",
"projects": {
"current": {
Expand All @@ -8,7 +9,8 @@
"url": "https://github.com/readthedocs/addons",
"type": "git"
},
"programming_language": "words"
"programming_language": "words",
"single_version": false
}
},
"versions": {
Expand Down
7 changes: 6 additions & 1 deletion src/flyout.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,15 @@ export class FlyoutElement extends LitElement {
}

renderHeader() {
let version = nothing;
if (!this.config.projects.current.single_version) {
version = html`<span>v: ${this.config.versions.current.slug}</span>`;
}

return html`
<header @click="${this._toggleOpen}">
<img class="logo" src="${READTHEDOCS_LOGO}" alt="Read the Docs" />
<span>v: ${this.config.versions.current.slug}</span>
${version}
</header>
`;
}
Expand Down

0 comments on commit fba6bf4

Please sign in to comment.