morgan pushed to branch tor-browser-128.1.0esr-14.0-1 at The Tor Project / Applications / Tor Browser

Commits:

1 changed file:

Changes:

  • toolkit/content/widgets/moz-toggle/moz-toggle.mjs
    ... ... @@ -34,6 +34,10 @@ export default class MozToggle extends MozLitElement {
    34 34
         description: { type: String },
    
    35 35
         ariaLabel: { type: String, attribute: "aria-label" },
    
    36 36
         accessKey: { type: String, attribute: "accesskey" },
    
    37
    +    // Extension for tor-browser. Used for tor-browser#41333.
    
    38
    +    title: { type: String, attribute: "title" },
    
    39
    +    // Extension for tor-browser. Used for tor-browser#40837.
    
    40
    +    labelAlignAfter: { type: Boolean, attribute: "label-align-after" },
    
    37 41
       };
    
    38 42
     
    
    39 43
       static get queries() {
    
    ... ... @@ -111,7 +115,11 @@ export default class MozToggle extends MozLitElement {
    111 115
       }
    
    112 116
     
    
    113 117
       render() {
    
    114
    -    // TODO: Reimplement labelAlignAfter!
    
    118
    +    // For tor-browser, we want to be able to place the label after the toggle
    
    119
    +    // as well.
    
    120
    +    // Used for the enable-bridges switch tor-browser#40837.
    
    121
    +    const labelAlignAfter = this.labelAlignAfter;
    
    122
    +
    
    115 123
         return html`
    
    116 124
           <link
    
    117 125
             rel="stylesheet"
    
    ... ... @@ -126,11 +134,12 @@ export default class MozToggle extends MozLitElement {
    126 134
                   for="moz-toggle-button"
    
    127 135
                   accesskey=${ifDefined(this.accessKey)}
    
    128 136
                 >
    
    137
    +              ${labelAlignAfter ? this.buttonTemplate() : ""}
    
    129 138
                   <span>
    
    130 139
                     ${this.label}
    
    131 140
                     ${!this.description ? this.supportLinkTemplate() : ""}
    
    132 141
                   </span>
    
    133
    -              ${this.buttonTemplate()}
    
    142
    +              ${labelAlignAfter ? "" : this.buttonTemplate()}
    
    134 143
                 </label>
    
    135 144
               `
    
    136 145
             : this.buttonTemplate()}