[tor-commits] [Git][tpo/applications/tor-browser][tor-browser-128.1.0esr-14.0-1] fixup! Customize moz-toggle for tor-browser.

morgan (@morgan) git at gitlab.torproject.org
Wed Aug 7 21:26:06 UTC 2024



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


Commits:
ab241f69 by Henry Wilkes at 2024-08-07T21:22:16+00:00
fixup! Customize moz-toggle for tor-browser.

Bug 42612: Reimplement the moz-toggle customization for 128 ESR.

- - - - -


1 changed file:

- toolkit/content/widgets/moz-toggle/moz-toggle.mjs


Changes:

=====================================
toolkit/content/widgets/moz-toggle/moz-toggle.mjs
=====================================
@@ -34,6 +34,10 @@ export default class MozToggle extends MozLitElement {
     description: { type: String },
     ariaLabel: { type: String, attribute: "aria-label" },
     accessKey: { type: String, attribute: "accesskey" },
+    // 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" },
   };
 
   static get queries() {
@@ -111,7 +115,11 @@ export default class MozToggle extends MozLitElement {
   }
 
   render() {
-    // TODO: Reimplement labelAlignAfter!
+    // For tor-browser, we want to be able to place the label after the toggle
+    // as well.
+    // Used for the enable-bridges switch tor-browser#40837.
+    const labelAlignAfter = this.labelAlignAfter;
+
     return html`
       <link
         rel="stylesheet"
@@ -126,11 +134,12 @@ export default class MozToggle extends MozLitElement {
               for="moz-toggle-button"
               accesskey=${ifDefined(this.accessKey)}
             >
+              ${labelAlignAfter ? this.buttonTemplate() : ""}
               <span>
                 ${this.label}
                 ${!this.description ? this.supportLinkTemplate() : ""}
               </span>
-              ${this.buttonTemplate()}
+              ${labelAlignAfter ? "" : this.buttonTemplate()}
             </label>
           `
         : this.buttonTemplate()}



View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/ab241f69e4595f38b64f523bfea9bf7099e184a8

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/ab241f69e4595f38b64f523bfea9bf7099e184a8
You're receiving this email because of your account on gitlab.torproject.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tor-commits/attachments/20240807/e8e0cb37/attachment-0001.htm>


More information about the tor-commits mailing list