From 674152dae15af61fa247a885ec6481f47679d0c3 Mon Sep 17 00:00:00 2001 From: Kevin Mehall Date: Wed, 10 Jul 2013 17:47:31 -0400 Subject: [PATCH] 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) --- zephyr/static/js/compose.js | 4 ++-- zephyr/static/js/ui.js | 20 ++++++-------------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/zephyr/static/js/compose.js b/zephyr/static/js/compose.js index e79f3aabdf..818f48fcee 100644 --- a/zephyr/static/js/compose.js +++ b/zephyr/static/js/compose.js @@ -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 () { diff --git a/zephyr/static/js/ui.js b/zephyr/static/js/ui.js index 5cc0c2933c..6ba4725375 100644 --- a/zephyr/static/js/ui.js +++ b/zephyr/static/js/ui.js @@ -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?