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: Created April 4, 2016, 9:09 a.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
@@ -1126,13 +1126,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 "switchToOptionsSection":
Thomas Greiner 2016/04/04 12:46:36 Detail: Is this specific to the options page? We c
Sebastian Noack 2016/04/05 13:32:02 Fine with me using a more generic name that doesn'
Thomas Greiner 2016/04/06 12:49:12 I'd suggest "focusSection" to no limit ourselves t
Sebastian Noack 2016/04/06 17:38:29 Done.
+ document.body.setAttribute("data-tab", message.args[0]);
+ break;
}
break;
case "filters.respond":
@@ -1150,7 +1155,7 @@
ext.backgroundPage.sendMessage(
{
type: "app.listen",
- filter: ["addSubscription"]
+ filter: ["addSubscription", "switchToOptionsSection"]
});
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