message_edit: Restyle message_controls options to have better spacing.

This restyles the message_controls options to center them horizontally
while fixing them closer to the right side of the edge, along with just
replacing the edit button with a preview source button once editing is
disabled.
This commit is contained in:
Brock Whittaker 2016-11-10 15:41:00 -08:00 committed by Tim Abbott
parent 5497416a36
commit d45c050994
3 changed files with 10 additions and 9 deletions

View File

@ -107,8 +107,8 @@ function message_unhover() {
function message_hover(message_row) {
var message;
var edit_content_button = '<i class="icon-vector-pencil edit_content_button"></i>';
var id = parseInt(message_row.attr("zid"), 10);
if (current_message_hover && message_row && current_message_hover.attr("zid") === message_row.attr("zid")) {
return;
}
@ -119,9 +119,10 @@ function message_hover(message_row) {
message = current_msg_list.get(rows.id(message_row));
message_unhover();
message_row.addClass('message_hovered');
if ((message_edit.get_editability(message) === message_edit.editability_types.FULL) &&
!message.status_message) {
message_row.find(".edit_content").html(edit_content_button);
if ((message_edit.get_editability(message) === message_edit.editability_types.FULL) && !message.status_message) {
message_row.find(".edit_content").html('<i class="icon-vector-pencil edit_content_button"></i>');
} else {
message_row.find(".edit_content").html('<i class="icon-vector-file-text-alt edit_content_button" data-msgid="' + id + '"></i>');
}
current_message_hover = message_row;
}

View File

@ -707,7 +707,7 @@ td.pointer {
display: inline-block;
position: absolute;
top: 2px;
right: -38px;
right: -55px;
}
.include-sender .message_controls {
@ -1124,10 +1124,10 @@ a.message_label_clickable:hover {
.edit_content {
display: inline-block;
position: relative;
left: 15px;
left: 22px;
width: 0px;
height: 0px;
opacity: .4;
color: #bbb;
}
.edit_content i {
@ -1190,7 +1190,7 @@ a.dark_background:hover,
.info {
display: inline-block;
position: relative;
left: 40px;
left: 3px;
font-size: 15px;
color: #bbb;
visibility: hidden;

View File

@ -38,8 +38,8 @@
<span class="message_star {{#if msg/starred}}icon-vector-star{{else}}icon-vector-star-empty empty-star{{/if}}"
title="{{#tr this}}{{#if msg/starred}}Unstar{{else}}Star{{/if}} this message{{/tr}}"></span>
</div>
<span class="edit_content"></span>
<div class="info actions_hover">
<span class="edit_content"></span>
<i class="icon-vector-chevron-down"></i>
</div>
<div class="message_failed {{#unless msg.failed_request}}notvisible{{/unless}}">