Skip to content

Commit

Permalink
focus, modify view: make submit button default
Browse files Browse the repository at this point in the history
reverse the order of button inputs (sumbit/OK first) in DOM, and thus
submit is the default on enter

to keep the order reversed when viewed (first cancel, then OK), reverse
the display with CSS

fixes moinwiki#1559
  • Loading branch information
wagner-intevation committed Nov 19, 2023
1 parent b071d59 commit 438db65
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/moin/themes/focus/static/css/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ header a:visited, #top-bar a:visited { color: #242424; }
padding: 0pt 6pt; }
.moin-form .submit-buttons { display: flex; column-gap: 8pt; justify-content: end;
margin: 12pt 0;
float: right;
display: flex;
flex-direction: row-reverse;
}
.moin-form button, .moin-form input[type="submit"] { clear: none; margin: unset; }
.moin-form button, .moin-button, .moin-form input[type="submit"] { display: flex;
Expand Down
10 changes: 5 additions & 5 deletions src/moin/themes/focus/templates/modify.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ <h1>{{ title }}</h1>
<button class="moin-button" type="button" >{{ _("Load Draft") }}</button>
{% set warning = _("Clicking this button will delete draft!") %}
{% endif %}
{{ gen.input(type='submit', id='moin-cancel-text-button', name='cancel', value=form.cancel_label,
class='moin-button moin-modify-submit negative', onclick="$('#moin-modify').removeClass('moin-changed-input')",
title=warning) }}
{{ gen.input(type='submit', id='moin-save-text-button', value=form.submit_label,
class='moin-button moin-modify-submit', title=warning, tabindex='-1') }}
{{ gen.input(type='submit', id='moin-preview-text-button', name='preview', value=form.preview_label,
class='moin-button moin-modify-submit', onclick="$('#moin-modify').removeClass('moin-changed-input')",
title=warning) }}
{{ gen.input(type='submit', id='moin-save-text-button', value=form.submit_label,
class='moin-button moin-modify-submit', title=warning) }}
{{ gen.input(type='submit', id='moin-cancel-text-button', name='cancel', value=form.cancel_label,
class='moin-button moin-modify-submit negative', onclick="$('#moin-modify').removeClass('moin-changed-input')",
title=warning) }}
</div>

{% endif %}
Expand Down

0 comments on commit 438db65

Please sign in to comment.