Show the recipient bar when the compose box is open, as long as

it's on a message that isn't faded.

Trac #1464

(imported from commit 7167ed0877d3885316b7d38af5f11ec5523d5f7d)
This commit is contained in:
Kevin Mehall
2013-07-10 17:47:31 -04:00
parent eccdb9505b
commit 674152dae1
2 changed files with 8 additions and 16 deletions

View File

@@ -88,7 +88,7 @@ exports.unfade_messages = function (clear_state) {
if (clear_state === true) {
focused_recipient = undefined;
}
ui.enable_floating_recipient_bar();
ui.update_floating_recipient_bar();
};
exports.update_faded_messages = function () {
@@ -114,7 +114,7 @@ exports.update_faded_messages = function () {
}
}
ui.disable_floating_recipient_bar();
ui.update_floating_recipient_bar();
};
exports.update_recipient_on_narrow = function () {

View File

@@ -354,7 +354,6 @@ function show_floating_recipient_bar() {
}
var old_label;
var disable_floating_recipient_bar = false;
function replace_floating_recipient_bar(desired_label) {
var new_label, other_label, header;
if (desired_label !== old_label) {
@@ -389,20 +388,7 @@ function hide_floating_recipient_bar() {
}
}
exports.disable_floating_recipient_bar = function () {
disable_floating_recipient_bar = true;
hide_floating_recipient_bar();
};
exports.enable_floating_recipient_bar = function () {
disable_floating_recipient_bar = false;
};
exports.update_floating_recipient_bar = function () {
if (disable_floating_recipient_bar) {
return;
}
var floating_recipient_bar = $("#floating_recipient_bar");
var floating_recipient_bar_top = floating_recipient_bar.offset().top;
var floating_recipient_bar_bottom = floating_recipient_bar_top + floating_recipient_bar.outerHeight();
@@ -441,6 +427,12 @@ exports.update_floating_recipient_bar = function () {
return;
}
// Hide if the message is faded
if (current_label.hasClass('message_reply_fade')) {
hide_floating_recipient_bar();
return;
}
// Hide if our bottom is in our bookend (or one bookend-height
// above it). This means we're not showing any useful part of the
// message above us, so why bother showing the label?