Add "all" and "subscribed" deeplink for subscriptions.

This adds a deep link to “all” which is to show all streams,
along with "subscribed" for only streams you are subscribed to.
This commit is contained in:
Brock Whittaker
2017-02-23 11:04:56 -08:00
committed by Tim Abbott
parent 461066cab9
commit 434317b4cc
2 changed files with 5 additions and 1 deletions

View File

@@ -388,7 +388,7 @@ $(function () {
e.preventDefault();
e.stopPropagation();
window.location.hash = "subscriptions/new";
window.location.hash = "subscriptions/all";
});
// FEEDBACK

View File

@@ -739,6 +739,10 @@ exports.change_state = (function () {
if (hash.arguments[0] === "new") {
$("#create_stream_button").click();
components.toggle.lookup("stream-filter-toggle").goto("All streams");
} else if (hash.arguments[0] === "all") {
components.toggle.lookup("stream-filter-toggle").goto("All streams");
} else if (hash.arguments[0] === "subscribed") {
components.toggle.lookup("stream-filter-toggle").goto("Subscribed");
// if the first argument is a valid number.
} else if (/\d+/.test(hash.arguments[0])) {
var $stream_row = $(".stream-row[data-stream-id='" + hash.arguments[0] + "']");