mirror of https://github.com/zulip/zulip.git
click_handlers: Refactor select_message_function.
This uses the early-return pattern to make the main click handler for opening the compose box more readable.
This commit is contained in:
parent
ce9f21545a
commit
3f47c0f8bc
|
@ -85,7 +85,11 @@ exports.initialize = function () {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(document.getSelection().type === "Range")) {
|
if (document.getSelection().type === "Range") {
|
||||||
|
// Drags on the message (to copy message text) shouldn't trigger a reply.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const row = $(this).closest(".message_row");
|
const row = $(this).closest(".message_row");
|
||||||
const id = rows.id(row);
|
const id = rows.id(row);
|
||||||
|
|
||||||
|
@ -98,7 +102,6 @@ exports.initialize = function () {
|
||||||
compose_actions.respond_to_message({trigger: 'message click'});
|
compose_actions.respond_to_message({trigger: 'message click'});
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
popovers.hide_all();
|
popovers.hide_all();
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// if on normal non-mobile experience, a `click` event should run the message
|
// if on normal non-mobile experience, a `click` event should run the message
|
||||||
|
|
Loading…
Reference in New Issue