Bug 1966979 - Set type=checkbox properly on genai menuitems. r=firefox-ai-ml-reviewers,Mardak
On Linux (and maybe macOS) this has always been broken. Differential Revision: https://phabricator.services.mozilla.com/D249850
This commit is contained in:
committed by
ealvarez@mozilla.com
parent
d1f59b18d4
commit
b9b4aa5db3
@@ -287,15 +287,19 @@ function renderMore() {
|
|||||||
],
|
],
|
||||||
].forEach(([type, l10n, command, checked]) => {
|
].forEach(([type, l10n, command, checked]) => {
|
||||||
const item = menu.appendChild(topDoc.createXULElement(type));
|
const item = menu.appendChild(topDoc.createXULElement(type));
|
||||||
if (type == "menuitem") {
|
if (type != "menuitem") {
|
||||||
document.l10n.setAttributes(item, ...l10n);
|
return;
|
||||||
item.addEventListener("command", () => {
|
}
|
||||||
command();
|
document.l10n.setAttributes(item, ...l10n);
|
||||||
Glean.genaiChatbot.sidebarMoreMenuClick.record({
|
item.addEventListener("command", () => {
|
||||||
action: command.name,
|
command();
|
||||||
provider: providerId,
|
Glean.genaiChatbot.sidebarMoreMenuClick.record({
|
||||||
});
|
action: command.name,
|
||||||
|
provider: providerId,
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
if (checked !== undefined) {
|
||||||
|
item.setAttribute("type", "checkbox");
|
||||||
if (checked) {
|
if (checked) {
|
||||||
item.setAttribute("checked", true);
|
item.setAttribute("checked", true);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user