Combine the actions popover with the timeinfo popover

The message timestamp is now always clickable, and the popover contains the
full long-form date and time.  This addresses one problem from usability
testing (see #470).

(imported from commit ad502dff128ad1c934fc0d3faaf5e2931c91c37e)
This commit is contained in:
Keegan McAllister
2013-02-08 21:29:40 -05:00
parent 520d7b1f97
commit 16d62fe5de
9 changed files with 55 additions and 41 deletions

View File

@@ -387,24 +387,16 @@ function show_actions_popover(element, id) {
select_message_by_id(id);
var elt = $(element);
if (elt.data('popover') === undefined) {
var content, message = message_dict[id];
if (elt.hasClass("message_sender") || elt.hasClass("profile_picture")) {
elt.popover({placement: "bottom",
title: templates.actions_popover_title(message),
content: templates.actions_popover_content(message),
trigger: "manual"
});
} else if (elt.hasClass("message_time")) {
if (!narrow.active()) {
// Only show the time-travel popover when narrowed
return;
}
// Bootstrap takes the title from the 'title' attribute of elt
elt.popover({placement: "bottom",
content: templates.timeinfo_popover_content(message),
trigger: "manual"
});
}
var args = {
message: message_dict[id],
narrowed: narrow.active()
};
elt.popover({
placement: "bottom",
title: templates.actions_popover_title(args),
content: templates.actions_popover_content(args),
trigger: "manual"
});
elt.popover("show");
current_actions_popover_elem = elt;
}