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: Extracted button creation into own function Created Sept. 11, 2015, 1:50 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
« no previous file with comments | « 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 + "']");
+ 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
« no previous file with comments | « options.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld