mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
ui: fix discussion_edit ctrl+enter hotkey
This commit is contained in:
1 parent
e365c3ccd6
commit
013ae1172b
3 files changed
+5
-3
No files matched your search
@@ -146,7 +146,9 @@ export function registerAction(
|
|||||||
monaco.KeyMod.WinCtrl | monaco.KeyCode.Enter,
|
monaco.KeyMod.WinCtrl | monaco.KeyCode.Enter,
|
||||||
],
|
],
|
||||||
run: () => {
|
run: () => {
|
||||||
$(element).closest('form').submit();
|
const form = $(element).closest('form');
|
||||||
|
if (form.find('[data-default-submit]').length) form.find('[data-default-submit]').click();
|
||||||
|
else form.submit();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
extra_textarea_class:'auto-resize'
|
extra_textarea_class:'auto-resize'
|
||||||
}) }}
|
}) }}
|
||||||
<div class="row"><div class="columns">
|
<div class="row"><div class="columns">
|
||||||
<button name="operation" value="{{ 'update' if ddoc else 'create' }}" type="submit" class="rounded primary button">
|
<button name="operation" value="{{ 'update' if ddoc else 'create' }}" data-default-submit type="submit" class="rounded primary button">
|
||||||
{{ _('Update') if ddoc else _('Create') }} (Ctrl+Enter)
|
{{ _('Update') if ddoc else _('Create') }} (Ctrl+Enter)
|
||||||
</button>
|
</button>
|
||||||
{% if ddoc and (handler.user.hasPriv(PRIV.PRIV_EDIT_SYSTEM) or handler.user.own(ddoc)) %}
|
{% if ddoc and (handler.user.hasPriv(PRIV.PRIV_EDIT_SYSTEM) or handler.user.own(ddoc)) %}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
{% include "partials/discussion_edit_form.html" %}
|
{% include "partials/discussion_edit_form.html" %}
|
||||||
<div class="row"><div class="columns">
|
<div class="row"><div class="columns">
|
||||||
<input type="hidden" name="csrfToken" value="{{ handler.csrfToken }}">
|
<input type="hidden" name="csrfToken" value="{{ handler.csrfToken }}">
|
||||||
<button name="operation" value="update" type="submit" class="rounded primary button">
|
<button name="operation" value="update" data-default-submit type="submit" class="rounded primary button">
|
||||||
{{ _('Update') }} (Ctrl+Enter)
|
{{ _('Update') }} (Ctrl+Enter)
|
||||||
</button>
|
</button>
|
||||||
{% if handler.user.own(ddoc) or handler.user.hasPerm(perm.PERM_DELETE_DISCUSSION) %}
|
{% if handler.user.own(ddoc) or handler.user.hasPerm(perm.PERM_DELETE_DISCUSSION) %}
|
||||||
|
|||||||
Reference in new issue
Block a user