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:
Steve Howell
2014-01-17 12:23:39 -05:00
parent a9e621fff4
commit bca0311b53
3 changed files with 28 additions and 0 deletions

View File

@@ -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);
};