Index: js/desktop-options.js |
=================================================================== |
--- a/js/desktop-options.js |
+++ b/js/desktop-options.js |
@@ -1348,21 +1348,26 @@ |
{ |
return browser.runtime.sendMessage({ |
type: "filters.get", |
subscriptionUrl: subscription.url}); |
} |
function hidePref(key, value) |
{ |
- let element = document.querySelector("[data-pref='" + key + "']"); |
+ const element = getPrefElement(key); |
if (element) |
element.setAttribute("aria-hidden", value); |
} |
+function getPrefElement(key) |
+{ |
+ return document.querySelector("[data-pref='" + key + "']"); |
+} |
+ |
function getPref(key, callback) |
{ |
let checkPref = getPref.checks[key] || getPref.checkNone; |
checkPref((isActive) => |
{ |
if (!isActive) |
{ |
hidePref(key, !isActive); |
@@ -1447,17 +1452,26 @@ |
case "addSubscription": |
let subscription = message.args[0]; |
let dialog = E("dialog-content-predefined"); |
dialog.querySelector("h3").textContent = subscription.title || ""; |
dialog.querySelector(".url").textContent = subscription.url; |
openDialog("predefined"); |
break; |
case "focusSection": |
- document.body.setAttribute("data-tab", message.args[0]); |
+ let section = message.args[0]; |
+ if (section == "notifications") |
+ { |
+ section = "advanced"; |
+ const elem = getPrefElement("notifications_ignoredcategories"); |
+ elem.classList.add("highlight-animate"); |
+ elem.querySelector("button").focus(); |
+ } |
+ |
+ selectTabItem(section, document.body, false); |
break; |
} |
break; |
case "filters.respond": |
onFilterMessage(message.action, message.args[0]); |
break; |
case "prefs.respond": |
onPrefMessage(message.action, message.args[0], false); |