mirror of https://github.com/zulip/zulip.git
emoji_picker: Change reaction popover's base element.
Change the reaction popover to be based off the container elements for the various message control icons. This will enable us to easily control the visibility of the base element when the popover is opened or closed. Also removes redundant `reactions_hover` class.
This commit is contained in:
parent
16885ef0a7
commit
afba03f84e
|
@ -618,7 +618,7 @@ exports.register_click_handlers = function () {
|
|||
emoji_picker.toggle_emoji_popover(this);
|
||||
});
|
||||
|
||||
$("#main_div").on("click", ".reactions_hover, .reaction_button", function (e) {
|
||||
$("#main_div").on("click", ".reaction_button", function (e) {
|
||||
e.stopPropagation();
|
||||
|
||||
var message_id = rows.get_message_id(this);
|
||||
|
@ -634,7 +634,8 @@ exports.register_click_handlers = function () {
|
|||
// message wasn't sent by us and thus the .reaction_hover
|
||||
// element is not present, we use the message's
|
||||
// .icon-vector-chevron-down element as the base for the popover.
|
||||
emoji_picker.toggle_emoji_popover($(".selected_message .icon-vector-chevron-down")[0], msgid);
|
||||
var elem = $(".selected_message .actions_hover")[0];
|
||||
emoji_picker.toggle_emoji_popover(elem, msgid);
|
||||
});
|
||||
|
||||
$("body").on("click", ".emoji-popover-tab-item", function (e) {
|
||||
|
|
|
@ -17,9 +17,9 @@ function focus_in_empty_compose() {
|
|||
|
||||
function open_reactions() {
|
||||
var message = current_msg_list.selected_message();
|
||||
var target = $(current_msg_list.selected_row()).find(".icon-vector-chevron-down")[0];
|
||||
var target = $(current_msg_list.selected_row()).find(".actions_hover")[0];
|
||||
if (!message.sent_by_me) {
|
||||
target = $(current_msg_list.selected_row()).find(".icon-vector-smile")[0];
|
||||
target = $(current_msg_list.selected_row()).find(".reaction_button")[0];
|
||||
}
|
||||
emoji_picker.toggle_emoji_popover(target, current_msg_list.selected_id());
|
||||
return true;
|
||||
|
|
|
@ -1189,21 +1189,16 @@ a.message_label_clickable:hover {
|
|||
color: hsl(200, 100%, 40%);
|
||||
}
|
||||
|
||||
.reactions_hover {
|
||||
.message_controls > .reaction_button {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
color: hsl(0, 0%, 73%);
|
||||
}
|
||||
|
||||
.reactions_hover:hover {
|
||||
.message_controls > .reaction_button:hover {
|
||||
color: hsl(200, 100%, 40%);
|
||||
}
|
||||
|
||||
.message_hovered .reactions_hover,
|
||||
.has_emoji_popover .reactions_hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.message_hovered .info,
|
||||
.has_actions_popover .info,
|
||||
.message_hovered .empty-star {
|
||||
|
|
|
@ -44,8 +44,8 @@
|
|||
{{#if msg/sent_by_me}}
|
||||
<div class="edit_content"></div>
|
||||
{{else}}
|
||||
<div class="reactions_hover">
|
||||
<i class="icon-vector-smile reaction_button" title="{{#tr this}}Add emoji reaction{{/tr}} (:)"></i>
|
||||
<div class="reaction_button">
|
||||
<i class="icon-vector-smile" title="{{#tr this}}Add emoji reaction{{/tr}} (:)"></i>
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="info actions_hover">
|
||||
|
|
Loading…
Reference in New Issue