mirror of https://github.com/zulip/zulip.git
Colorize the stream bar in the composebox based on where we're writing.
(imported from commit 8e9bddf465661826d63fe0f79e3f1bd6b903cf4d)
This commit is contained in:
parent
45927e19eb
commit
7a6068c3ad
|
@ -51,6 +51,15 @@ function show(tabname, focus_area) {
|
|||
focus_area.select();
|
||||
}
|
||||
|
||||
// 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);
|
||||
$("#stream-message .message_header_stream").css("background-color", color);
|
||||
};
|
||||
|
||||
exports.start = function (msg_type, opts) {
|
||||
if (reload.is_in_progress()) {
|
||||
return;
|
||||
|
@ -89,6 +98,7 @@ exports.start = function (msg_type, opts) {
|
|||
}
|
||||
|
||||
is_composing_message = msg_type;
|
||||
exports.decorate_stream_bar(opts.stream);
|
||||
$(document).trigger($.Event('compose_started.zephyr', opts));
|
||||
};
|
||||
|
||||
|
|
|
@ -685,6 +685,8 @@ $(function () {
|
|||
$("#search_up") .on("click", function () { search.search_button_handler(true); });
|
||||
$("#search_down").on("click", function () { search.search_button_handler(false); });
|
||||
$("#search_exit").on("click", search.clear_search);
|
||||
|
||||
$("#stream").on('blur', function () { compose.decorate_stream_bar(this.value); });
|
||||
});
|
||||
|
||||
return exports;
|
||||
|
|
Loading…
Reference in New Issue