From 4b75ad9441b2111540431610997a764761172f35 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 30 Jun 2019 17:15:51 +0200 Subject: [PATCH] Submit form builder dialog form on enter in certain input fields See #2509 --- com.woltlab.wcf/templates/__numericFormField.tpl | 1 + com.woltlab.wcf/templates/__textFormField.tpl | 1 + com.woltlab.wcf/templates/__usernameFormField.tpl | 1 + wcfsetup/install/files/acp/templates/__numericFormField.tpl | 1 + wcfsetup/install/files/acp/templates/__textFormField.tpl | 1 + wcfsetup/install/files/acp/templates/__usernameFormField.tpl | 1 + 6 files changed, 6 insertions(+) diff --git a/com.woltlab.wcf/templates/__numericFormField.tpl b/com.woltlab.wcf/templates/__numericFormField.tpl index 685f7fdda6..0cf95031b3 100644 --- a/com.woltlab.wcf/templates/__numericFormField.tpl +++ b/com.woltlab.wcf/templates/__numericFormField.tpl @@ -16,6 +16,7 @@ *}{if $field->getMinimum() !== null} min="{$field->getMinimum()}"{/if}{* *}{if $field->getMaximum() !== null} max="{$field->getMaximum()}"{/if}{* *}{if $field->getPlaceholder() !== null} placeholder="{$field->getPlaceholder()}"{/if}{* + *}{if $field->getDocument()->isAjax()} data-dialog-submit-on-enter="true"{/if}{* *}> {if $field->getSuffix() !== null} diff --git a/com.woltlab.wcf/templates/__textFormField.tpl b/com.woltlab.wcf/templates/__textFormField.tpl index 0669131310..ec09c659d1 100644 --- a/com.woltlab.wcf/templates/__textFormField.tpl +++ b/com.woltlab.wcf/templates/__textFormField.tpl @@ -11,6 +11,7 @@ *}{if $field->getMinimumLength() !== null} minlength="{$field->getMinimumLength()}"{/if}{* *}{if $field->getMaximumLength() !== null} maxlength="{$field->getMaximumLength()}"{/if}{* *}{if $field->getPlaceholder() !== null} placeholder="{$field->getPlaceholder()}"{/if}{* + *}{if $field->getDocument()->isAjax()} data-dialog-submit-on-enter="true"{/if}{* *}> {if $field->isI18n()} diff --git a/com.woltlab.wcf/templates/__usernameFormField.tpl b/com.woltlab.wcf/templates/__usernameFormField.tpl index 4e502abff7..a857c80246 100644 --- a/com.woltlab.wcf/templates/__usernameFormField.tpl +++ b/com.woltlab.wcf/templates/__usernameFormField.tpl @@ -11,6 +11,7 @@ *}{if $field->getMinimumLength() !== null} minlength="{$field->getMinimumLength()}"{/if}{* *}{if $field->getMaximumLength() !== null} maxlength="{$field->getMaximumLength()}"{/if}{* *}{if $field->getPlaceholder() !== null} placeholder="{$field->getPlaceholder()}"{/if}{* + *}{if $field->getDocument()->isAjax()} data-dialog-submit-on-enter="true"{/if}{* *}> {include file='__formFieldFooter'} diff --git a/wcfsetup/install/files/acp/templates/__numericFormField.tpl b/wcfsetup/install/files/acp/templates/__numericFormField.tpl index 685f7fdda6..0cf95031b3 100644 --- a/wcfsetup/install/files/acp/templates/__numericFormField.tpl +++ b/wcfsetup/install/files/acp/templates/__numericFormField.tpl @@ -16,6 +16,7 @@ *}{if $field->getMinimum() !== null} min="{$field->getMinimum()}"{/if}{* *}{if $field->getMaximum() !== null} max="{$field->getMaximum()}"{/if}{* *}{if $field->getPlaceholder() !== null} placeholder="{$field->getPlaceholder()}"{/if}{* + *}{if $field->getDocument()->isAjax()} data-dialog-submit-on-enter="true"{/if}{* *}> {if $field->getSuffix() !== null} diff --git a/wcfsetup/install/files/acp/templates/__textFormField.tpl b/wcfsetup/install/files/acp/templates/__textFormField.tpl index 0669131310..ec09c659d1 100644 --- a/wcfsetup/install/files/acp/templates/__textFormField.tpl +++ b/wcfsetup/install/files/acp/templates/__textFormField.tpl @@ -11,6 +11,7 @@ *}{if $field->getMinimumLength() !== null} minlength="{$field->getMinimumLength()}"{/if}{* *}{if $field->getMaximumLength() !== null} maxlength="{$field->getMaximumLength()}"{/if}{* *}{if $field->getPlaceholder() !== null} placeholder="{$field->getPlaceholder()}"{/if}{* + *}{if $field->getDocument()->isAjax()} data-dialog-submit-on-enter="true"{/if}{* *}> {if $field->isI18n()} diff --git a/wcfsetup/install/files/acp/templates/__usernameFormField.tpl b/wcfsetup/install/files/acp/templates/__usernameFormField.tpl index 4e502abff7..a857c80246 100644 --- a/wcfsetup/install/files/acp/templates/__usernameFormField.tpl +++ b/wcfsetup/install/files/acp/templates/__usernameFormField.tpl @@ -11,6 +11,7 @@ *}{if $field->getMinimumLength() !== null} minlength="{$field->getMinimumLength()}"{/if}{* *}{if $field->getMaximumLength() !== null} maxlength="{$field->getMaximumLength()}"{/if}{* *}{if $field->getPlaceholder() !== null} placeholder="{$field->getPlaceholder()}"{/if}{* + *}{if $field->getDocument()->isAjax()} data-dialog-submit-on-enter="true"{/if}{* *}> {include file='__formFieldFooter'} -- 2.20.1