Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

compose: Move send button after textarea in DOM.

Gittenburg05e792ec1a70
diff --git a/static/styles/compose.scss b/static/styles/compose.scss
index d3f6850722f..beb1e8a2e91 100644
--- a/static/styles/compose.scss
+++ b/static/styles/compose.scss
@@ -349,6 +349,27 @@ input.recipient_box {
width: 100%;
}
+#compose-send-button {
+ /* To arrange the right tab order for the compose box keyboard UI,
+ this element appears before its proper position in the DOM and is configured
+ to float right, so that tabbing from the compose box goes here and then
+ to the message controls to its left, to ensure "Tab then Enter" sends messages. */
+ border-radius: 4px;
+ padding-top: 3px;
+ padding-bottom: 3px;
+ margin-bottom: 0;
+ font-weight: 600;
+ border: 1px solid hsl(170, 68%, 41%);
+ background-color: hsl(170, 48%, 54%);
+ color: hsl(0, 0%, 100%);
+ float: right;
+ font-size: 0.9em;
+
+ &:focus {
+ box-shadow: 0 0 10px hsl(170, 48%, 54%), 0 0 5px hsl(170, 48%, 54%);
+ }
+}
+
#send_controls {
float: right;
position: relative;
@@ -359,20 +380,6 @@ input.recipient_box {
color: hsl(0, 0%, 67%);
margin: 4px;
}
-
- #compose-send-button {
- border-radius: 4px;
- padding-top: 3px;
- padding-bottom: 3px;
- font-weight: 600;
- border: 1px solid hsl(170, 68%, 41%);
- background-color: hsl(170, 48%, 54%);
- color: hsl(0, 0%, 100%);
-
- &:focus {
- box-shadow: 0 0 10px hsl(170, 48%, 54%), 0 0 5px hsl(170, 48%, 54%);
- }
- }
}
#stream-message,
diff --git a/templates/zerver/app/compose.html b/templates/zerver/app/compose.html
index 113c9fd0172..2593b16864a 100644
--- a/templates/zerver/app/compose.html
+++ b/templates/zerver/app/compose.html
@@ -94,6 +94,7 @@
</div>
<div class="drag"></div>
<div id="below-compose-content">
+ <button type="submit" id="compose-send-button" class="button small send_message" title="{{ _('Send') }} (Ctrl + Enter)">{{ _('Send') }}</button>
<input type="file" id="file_input" class="notvisible pull-left" multiple />
<a class="message-control-button fa fa-smile-o" aria-label="{{_('Add emoji')}}" id="emoji_map" tabindex=0 title="{{ _('Add emoji') }}"></a>
<a class="message-control-button fa fa-font" aria-label="{{ _('Formatting') }}" tabindex=0 title="{{ _('Formatting') }}" data-overlay-trigger="message-formatting"></a>
@@ -110,7 +111,6 @@
<input type="checkbox" id="enter_sends" />
<span></span>{{ _('Press Enter to send') }}
</label>
- <button type="submit" id="compose-send-button" class="button small send_message" title="{{ _('Send') }} (Ctrl + Enter)">{{ _('Send') }}</button>
</div>
</div>
</div>