stream settings: Extract setup_subscriptions_tab_hash function.

This commit is contained in:
Yashashvi Dave
2019-04-06 16:25:16 +05:30
committed by Tim Abbott
parent ec5ef08a19
commit 460515a2ee
2 changed files with 11 additions and 6 deletions

View File

@@ -7,6 +7,16 @@ function setup_subscriptions_stream_hash(sub) {
hashchange.update_browser_history(hash);
}
exports.setup_subscriptions_tab_hash = function (tab_key_value) {
if (tab_key_value === "all-streams") {
hashchange.update_browser_history('#streams/all');
} else if (tab_key_value === "subscribed") {
hashchange.update_browser_history('#streams/subscribed');
} else {
blueslip.debug("Unknown tab_key_value: " + tab_key_value);
}
};
function settings_for_sub(sub) {
var id = parseInt(sub.stream_id, 10);
return $("#subscription_overlay .subscription_settings[data-stream-id='" + id + "']");

View File

@@ -534,12 +534,7 @@ exports.switch_stream_tab = function (tab_name) {
}
exports.actually_filter_streams();
if (tab_name === "all-streams") {
hashchange.update_browser_history('#streams/all');
} else if (tab_name === "subscribed") {
hashchange.update_browser_history('#streams/subscribed');
}
stream_edit.setup_subscriptions_tab_hash(tab_name);
};
exports.setup_page = function (callback) {