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

Unified Diff: options.js

Issue 29339320: Issue 3887 - Support bringing up the new options page with a specific tab focused (Closed)
Patch Set: Rename switchToOptionsSection to focusSection Created April 6, 2016, 5:37 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 | « no previous file | 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
@@ -1133,13 +1133,18 @@
switch (message.type)
{
case "app.respond":
- if (message.action == "addSubscription")
+ switch (message.action)
{
- var subscription = message.args[0];
- var dialog = E("dialog-content-predefined");
- dialog.querySelector("h3").textContent = subscription.title || "";
- dialog.querySelector(".url").textContent = subscription.url;
- openDialog("predefined");
+ case "addSubscription":
+ var subscription = message.args[0];
+ var 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]);
+ break;
}
break;
case "filters.respond":
@@ -1157,7 +1162,7 @@
ext.backgroundPage.sendMessage(
{
type: "app.listen",
- filter: ["addSubscription"]
+ filter: ["addSubscription", "focusSection"]
});
ext.backgroundPage.sendMessage(
{
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld