mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 16:37:23 +00:00
Automatically condense long messages
Addresses Trac #747. (imported from commit 4ddf2d8773023805650f04924be62da2d0fe826e)
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user