Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
message_edit: Add styles for Save and Cancel buttons.
Karl Stolleya929220d3ce4
diff --git a/web/styles/message_row.css b/web/styles/message_row.cssindex 8fa4169e59b..3ce01d5f604 100644--- a/web/styles/message_row.css+++ b/web/styles/message_row.css@@ -476,7 +476,52 @@ $time_column_min_width: 42px; /* + padding */margin-top: 5px;display: flex;gap: 5px;- align-items: baseline;+ /* Allow items to occupy full height.+ This is especially important for+ buttons that are flex items. */+ align-items: stretch;+ }++ .message-actions-button {+ box-sizing: border-box;+ height: 28px;+ padding: 6px 10px;+ border-radius: 4px;+ border: 0;+ margin-bottom: 0;+ line-height: 1;+ }++ .message_edit_save {+ /* Match Save button's basic colors to+ the compose box Send button. */+ color: var(--color-compose-send-button-icon-color);+ background-color: var(--color-compose-send-button-background);++ &:hover {+ background-color: var(+ --color-compose-send-button-background-interactive+ );+ }++ &:disabled {+ /* Replicate the `.new-style` disabled values,+ without any color shifts. */+ cursor: not-allowed;+ filter: saturate(0);+ opacity: 0.5;+ }+ }++ .message_edit_cancel,+ .message_edit_close {+ color: var(--color-exit-button-text);+ background: var(--color-exit-button-background);+ border: 1px solid var(--color-exit-button-border);++ &:hover {+ background: var(--color-exit-button-background-interactive);+ }}}diff --git a/web/styles/zulip.css b/web/styles/zulip.cssindex d49359144ba..a7292c9293d 100644--- a/web/styles/zulip.css+++ b/web/styles/zulip.css@@ -2012,6 +2012,9 @@ div.focused-message-list {.message-edit-timer {display: none;+ /* Center vertically relative to+ buttons. */+ align-self: center;/* Use flexbox to position to far right ofthe Save and Cancel buttons. */margin-left: auto;diff --git a/web/templates/message_edit_form.hbs b/web/templates/message_edit_form.hbsindex a3c041937d7..0f563ee5626 100644--- a/web/templates/message_edit_form.hbs+++ b/web/templates/message_edit_form.hbs@@ -17,23 +17,25 @@<div class="message-edit-feature-group">{{> compose_control_buttons }}</div>+ {{/if}}<div class="message-edit-buttons-and-timer">- <div class="message_edit_save_container"- data-tippy-content="{{t 'You can no longer save changes to this message.' }}">- <button type="button" class="button small rounded sea-green message_edit_save">- <img class="loader" alt="" src="" />- <span>{{t "Save" }}</span>- </button>- </div>- <button type="button" class="button small rounded message_edit_cancel">{{t "Cancel" }}</button>- <div class="message-edit-timer">- <span class="message_edit_countdown_timer- tippy-zulip-tooltip" data-tippy-content="{{t 'This organization is configured to restrict editing of message content to {minutes_to_edit} minutes after it is sent.' }}"></span>- </div>+ {{#if is_editable}}+ <div class="message_edit_save_container"+ data-tippy-content="{{t 'You can no longer save changes to this message.' }}">+ <button type="button" class="message-actions-button message_edit_save">+ <img class="loader" alt="" src="" />+ <span>{{t "Save" }}</span>+ </button>+ </div>+ <button type="button" class="message-actions-button message_edit_cancel"><span>{{t "Cancel" }}</span></button>+ <div class="message-edit-timer">+ <span class="message_edit_countdown_timer+ tippy-zulip-tooltip" data-tippy-content="{{t 'This organization is configured to restrict editing of message content to {minutes_to_edit} minutes after it is sent.' }}"></span>+ </div>+ {{else}}+ <button type="button" class="message-actions-button message_edit_close"><span>{{t "Close" }}</span></button>+ {{/if}}</div>- {{else}}- <button type="button" class="button small rounded message_edit_close">{{t "Close" }}</button>- {{/if}}</div></div></form>