Commit 0a9734a0 authored by Dave Barker's avatar Dave Barker 🐈

Refs #64 - Fix "Open all links" notification buttons

parent e079e431
Pipeline #78893478 passed with stages
in 7 minutes and 36 seconds
......@@ -124,7 +124,8 @@ function getNotificationButtons({type: notificationType, links}, message)
buttons = [
{
type: "open-all",
title: browser.i18n.getMessage("notification_open_all")
title: browser.i18n.getMessage("notification_open_all"),
links
}
];
}
......@@ -143,12 +144,18 @@ function getNotificationButtons({type: notificationType, links}, message)
function openNotificationLinks(notificationId)
{
let buttons = buttonsByNotificationId.get(notificationId) || [];
let links = [];
for (let button of buttons)
{
if (button.type == "link" && button.link)
browser.tabs.create({url: Utils.getDocLink(button.link)});
links.push(button.link);
else if (button.type == "open-all" && button.links)
links = links.concat(button.links);
}
for (let link of links)
browser.tabs.create({url: Utils.getDocLink(link)});
}
function notificationButtonClick(notificationId, buttonIndex)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment