Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor Browser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Applications
Tor Browser
Commits
d6954528
Commit
d6954528
authored
Aug 23, 2023
by
henry
Committed by
Beatriz Rizental
3 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Customize moz-toggle for tor-browser.
parent
88d9ac25
No related branches found
No related tags found
1 merge request
!1507
Rebase Tor Browser onto 136.0a1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
toolkit/content/widgets/moz-toggle/moz-toggle.mjs
+11
-0
11 additions, 0 deletions
toolkit/content/widgets/moz-toggle/moz-toggle.mjs
with
11 additions
and
0 deletions
toolkit/content/widgets/moz-toggle/moz-toggle.mjs
+
11
−
0
View file @
d6954528
...
...
@@ -25,6 +25,10 @@ export default class MozToggle extends MozBaseInputElement {
static
properties
=
{
ariaLabel
:
{
type
:
String
,
mapped
:
true
},
pressed
:
{
type
:
Boolean
,
reflect
:
true
},
// Extension for tor-browser. Used for tor-browser#41333.
title
:
{
type
:
String
,
attribute
:
"
title
"
},
// Extension for tor-browser. Used for tor-browser#40837.
labelAlignAfter
:
{
type
:
Boolean
,
attribute
:
"
label-align-after
"
},
};
get
buttonEl
()
{
...
...
@@ -48,6 +52,12 @@ export default class MozToggle extends MozBaseInputElement {
inputTemplate
()
{
const
{
pressed
,
disabled
,
ariaLabel
,
handleClick
}
=
this
;
// For tor-browser, if we have a title we use it as the aria-description.
// Used for tor-browser#41333.
// Only set the description using the title if it differs from the
// accessible name derived from the label.
const
label
=
ariaLabel
||
this
.
label
;
const
ariaDescription
=
label
===
this
.
title
?
undefined
:
this
.
title
;
return
html
`<button
id="input"
part="button"
...
...
@@ -58,6 +68,7 @@ export default class MozToggle extends MozBaseInputElement {
?disabled=
${
disabled
}
aria-pressed=
${
pressed
}
aria-label=
${
ifDefined
(
ariaLabel
??
undefined
)}
aria-description=
${
ifDefined
(
ariaDescription
??
undefined
)}
aria-describedby="description"
accesskey=
${
ifDefined
(
this
.
accessKey
)}
@click=
${
handleClick
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment