From 0700b96f37330a9992be28ba48c7a30bfdcda88d Mon Sep 17 00:00:00 2001 From: Jessica McKellar Date: Tue, 6 Nov 2012 13:30:16 -0500 Subject: [PATCH] Hover the sender name on gravatar and e-mail hovers as well. This clarifies that clicking on any of those three pieces of information will pop up the user info tooltip. (imported from commit 1e57550d66acbb2e8d5d244d2997bbd394c334c3) --- zephyr/jstemplates/message.html | 6 +++--- zephyr/static/js/ui.js | 14 ++++++++++++++ zephyr/static/js/zephyr.js | 2 ++ zephyr/static/styles/zephyr.css | 5 +++++ 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/zephyr/jstemplates/message.html b/zephyr/jstemplates/message.html index 1960428461..d8d7f2f66d 100644 --- a/zephyr/jstemplates/message.html +++ b/zephyr/jstemplates/message.html @@ -50,7 +50,7 @@ onclick="select_message_by_id({{id}});"> {{#include_sender}} - {{/include_sender}} @@ -62,9 +62,9 @@ onmouseover="show_email({{id}});" onmouseout="hide_email();"> {{#include_sender}} - - {{sender_full_name}} + {{sender_full_name}} {{/include_sender}} diff --git a/zephyr/static/js/ui.js b/zephyr/static/js/ui.js index 34f86f876d..667a4e1d21 100644 --- a/zephyr/static/js/ui.js +++ b/zephyr/static/js/ui.js @@ -16,6 +16,20 @@ function register_onclick(message_row, message_id) { }); } +function register_user_info_mouseover(message_row, message_id) { + message_row.find(".user_info_hover").mouseover(function (e) { + show_email(message_id); + message_row.find(".sender_name").addClass("sender_hovered"); + }); +} + +function register_user_info_mouseout(message_row, message_id) { + message_row.find(".user_info_hover").mouseout(function (e) { + hide_email(); + message_row.find(".sender_name").removeClass("sender_hovered"); + }); +} + function focus_on(field_id) { // Call after autocompleting on a field, to advance the focus to // the next input field. diff --git a/zephyr/static/js/zephyr.js b/zephyr/static/js/zephyr.js index d4735e340f..5486f4fed6 100644 --- a/zephyr/static/js/zephyr.js +++ b/zephyr/static/js/zephyr.js @@ -346,6 +346,8 @@ function add_to_table(messages, table_name, filter_function, where) { $.each(messages_to_render, function (index, message) { var row = rows.get(message.id, table_name); register_onclick(row, message.id); + register_user_info_mouseover(row, message.id); + register_user_info_mouseout(row, message.id); row.find('.message_content a').each(function (index, link) { link = $(link); diff --git a/zephyr/static/styles/zephyr.css b/zephyr/static/styles/zephyr.css index 6cb334e9a0..ba3d68bace 100644 --- a/zephyr/static/styles/zephyr.css +++ b/zephyr/static/styles/zephyr.css @@ -168,6 +168,11 @@ td.pointer { font-weight: bold; } +.sender_hovered { + color: #0088CC; + text-decoration: underline; +} + .sender_email { font-size: 80%; color: gray;