Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: options.js

Issue 29327244: Issue 3024 - Added opt-out to Chrome notifications (Closed)
Patch Set: Created Sept. 10, 2015, 6:46 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« lib/notificationHelper.js ('K') | « options.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: options.js
===================================================================
--- a/options.js
+++ b/options.js
@@ -108,6 +108,24 @@
{
if (msg.type == "add-subscription")
startSubscriptionSelection(msg.title, msg.url);
+ else if (msg.type == "focus-section")
+ {
+ var tabs = document.getElementsByClassName("ui-tabs-panel");
+ for (var i = 0; i < tabs.length; i++)
+ {
+ var found = tabs[i].querySelector("[data-section='" + msg.section + "'");
Sebastian Noack 2015/09/11 10:58:26 It seems you forgot the closing ']' in the selecto
Thomas Greiner 2015/09/11 12:51:48 Done. Apparently, both `document.querySelector("[
Sebastian Noack 2015/09/11 13:09:54 My guess would be, that some popular browser didn'
+ if (!found)
+ continue;
+
+ var previous = document.getElementsByClassName("focused");
+ if (previous.length > 0)
+ previous[0].classList.remove("focused");
+
+ var tab = $("[href='#" + tabs[i].id + "']");
+ $("#tabs").tabs("select", tab.parent().index());
+ found.classList.add("focused");
+ }
+ }
};
// Reloads the displayed subscriptions and filters
« lib/notificationHelper.js ('K') | « options.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld