Show lock icon in compose box for invite-only streams (811)

(imported from commit c563fa605d850f39c3b3f0ae9530700f1d1b6e73)
This commit is contained in:
Steve Howell
2013-05-02 11:12:58 -04:00
parent ea55ed5ebb
commit c02540bfa6
2 changed files with 13 additions and 0 deletions

View File

@@ -56,12 +56,22 @@ function show(tabname, focus_area) {
notifications_bar.maybe_disable();
}
function update_lock_icon_for_stream(stream_name) {
var icon = $("#compose-lock-icon");
if (subs.get_invite_only(stream_name)) {
icon.show();
} else {
icon.hide();
}
}
// In an attempt to decrease mixing, make the composebox's
// stream bar look like what you're replying to.
// (In particular, if there's a color associated with it,
// have that color be reflected here too.)
exports.decorate_stream_bar = function (stream_name) {
var color = subs.get_color(stream_name);
update_lock_icon_for_stream(stream_name);
$("#stream-message .message_header_stream")
.css('background-color', color)
.removeClass(subs.color_classes)