mirror of
https://github.com/zulip/zulip.git
synced 2025-11-21 15:09:34 +00:00
stream settings: Extract setup_subscriptions_tab_hash function.
This commit is contained in:
committed by
Tim Abbott
parent
ec5ef08a19
commit
460515a2ee
@@ -7,6 +7,16 @@ function setup_subscriptions_stream_hash(sub) {
|
|||||||
hashchange.update_browser_history(hash);
|
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) {
|
function settings_for_sub(sub) {
|
||||||
var id = parseInt(sub.stream_id, 10);
|
var id = parseInt(sub.stream_id, 10);
|
||||||
return $("#subscription_overlay .subscription_settings[data-stream-id='" + id + "']");
|
return $("#subscription_overlay .subscription_settings[data-stream-id='" + id + "']");
|
||||||
|
|||||||
@@ -534,12 +534,7 @@ exports.switch_stream_tab = function (tab_name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
exports.actually_filter_streams();
|
exports.actually_filter_streams();
|
||||||
|
stream_edit.setup_subscriptions_tab_hash(tab_name);
|
||||||
if (tab_name === "all-streams") {
|
|
||||||
hashchange.update_browser_history('#streams/all');
|
|
||||||
} else if (tab_name === "subscribed") {
|
|
||||||
hashchange.update_browser_history('#streams/subscribed');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.setup_page = function (callback) {
|
exports.setup_page = function (callback) {
|
||||||
|
|||||||
Reference in New Issue
Block a user