Automatically condense long messages

Addresses Trac #747.

(imported from commit 4ddf2d8773023805650f04924be62da2d0fe826e)
This commit is contained in:
Jeff Arnold
2013-03-13 17:47:38 -04:00
parent 5b1aed7022
commit 70e5bd4049
4 changed files with 47 additions and 1 deletions

View File

@@ -877,7 +877,8 @@ $(function () {
$("#main_div").on("click", ".messagebox", function (e) {
var target = $(e.target);
if (target.is("a") || target.is("img.message_inline_image") || target.is("img.twitter-avatar")) {
if (target.is("a") || target.is("img.message_inline_image") || target.is("img.twitter-avatar") ||
target.is("div.message_length_controller")) {
// If this click came from a hyperlink, don't trigger the
// reply action. The simple way of doing this is simply
// to call e.stopPropagation() from within the link's
@@ -933,6 +934,20 @@ $(function () {
toggle_star(rows.id($(this).closest(".message_row")));
});
$("#home").on("click", ".message_expander", function (e) {
var row = $(this).closest(".message_row");
row.find(".message_content").addClass("expanded");
$(this).hide();
row.find(".message_collapser").show();
});
$("#home").on("click", ".message_collapser", function (e) {
var row = $(this).closest(".message_row");
row.find(".message_content").removeClass("expanded");
$(this).hide();
row.find(".message_expander").show();
});
$("#home").on("click", ".narrows_by_recipient", function (e) {
var nearest = current_msg_list.get(rows.id($(this).closest(".recipient_row")));
var selected = current_msg_list.selected_message();