Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

report: hide locale swap button unless feature is enabled #13192

Merged
merged 1 commit into from
Oct 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions report/assets/styles.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion report/assets/templates.html
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@
<a href="" class="lh-topbar__url" target="_blank" rel="noopener"></a>

<div class="lh-tools">
<div class="lh-tools-locale">
<div class="lh-tools-locale lh-hidden">
<button id="lh-button__swap-locales" class="lh-button lh-tool-locale__button" title="Show Language Picker" aria-label="Toggle language picker" aria-haspopup="menu" aria-expanded="false" aria-controls="lh-tools-locale__selector-wrapper">
<svg width="20px" height="20px" viewBox="0 0 24 24" fill="currentColor"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"/></svg>
</button>
Expand Down
4 changes: 2 additions & 2 deletions report/renderer/components.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions report/renderer/swap-locale-feature.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export class SwapLocaleFeature {
throw new Error('missing icuMessagePaths');
}

this._dom.find('.lh-tools-locale', this._dom.document()).classList.remove('lh-hidden');

const currentLocale = this._reportUIFeatures.json.configSettings.locale;

const containerEl = this._dom.find('.lh-tools-locale__selector-wrapper', this._dom.document());
Expand Down