mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
Created stream_list.redraw_stream_privacy().
This function can redraws the lock icon (or lack of lock icon) for a stream in the stream sidebar. It can be called when admins change the stream privacy. (imported from commit 880133d02525137094c48ecad8cf2dfff59f3307)
This commit is contained in:
@@ -147,6 +147,22 @@ exports.add_stream_to_sidebar = function (stream_name) {
|
||||
return build_stream_sidebar_row(stream_name);
|
||||
};
|
||||
|
||||
exports.redraw_stream_privacy = function (stream_name) {
|
||||
var li = exports.get_stream_li(stream_name);
|
||||
var div = li.find('.stream-privacy');
|
||||
var sub = stream_data.get_sub(stream_name);
|
||||
var color = stream_data.get_color(stream_name);
|
||||
var dark_background = stream_color.get_color_class(color);
|
||||
|
||||
var args = {
|
||||
invite_only: sub.invite_only,
|
||||
dark_background: dark_background
|
||||
};
|
||||
|
||||
var html = templates.render('stream_privacy', args);
|
||||
div.html(html);
|
||||
};
|
||||
|
||||
exports.get_stream_li = function (stream_name) {
|
||||
return get_filter_li('stream', stream_name);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user