Skip to content
Snippets Groups Projects
Commit d61be3f3 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Merge branch 'B18668_filepond_file_download_impossible_with_formModeGlobal_readonly' into 'develop'

filepond download for formModeGlobal=readonly, visual modifications

See merge request !737
parents 17edc74c b3672a22
No related branches found
No related tags found
2 merge requests!738New version v24.5.1,!737filepond download for formModeGlobal=readonly, visual modifications
Pipeline #12748 passed
...@@ -4341,7 +4341,7 @@ abstract class AbstractBuildForm { ...@@ -4341,7 +4341,7 @@ abstract class AbstractBuildForm {
$attribute .= Support::doAttribute('data-load', ($formElement[FE_DYNAMIC_UPDATE] === 'yes') ? 'data-load' : ''); $attribute .= Support::doAttribute('data-load', ($formElement[FE_DYNAMIC_UPDATE] === 'yes') ? 'data-load' : '');
$attribute .= Support::doAttribute('class', [$formElement[F_FE_FIELDSET_CLASS], ($formElement[FE_MODE] == FE_MODE_HIDDEN) ? FE_MODE_HIDDEN : '']); $attribute .= Support::doAttribute('class', [$formElement[F_FE_FIELDSET_CLASS], ($formElement[FE_MODE] == FE_MODE_HIDDEN) ? FE_MODE_HIDDEN : '']);
$attribute .= Support::doAttribute(ATTRIBUTE_DATA_REFERENCE, $formElement[FE_DATA_REFERENCE]); $attribute .= Support::doAttribute(ATTRIBUTE_DATA_REFERENCE, $formElement[FE_DATA_REFERENCE]);
$attribute .= HelperFormElement::getAttributeFeMode($formElement[FE_MODE], false); $attribute .= HelperFormElement::getAttributeFeMode($formElement[FE_MODE], false, $formElement[FE_TYPE]);
// <fieldset> // <fieldset>
$html = '<fieldset ' . $attribute . '>'; $html = '<fieldset ' . $attribute . '>';
......
...@@ -719,13 +719,13 @@ EOF; ...@@ -719,13 +719,13 @@ EOF;
* Set corresponding html attributes readonly/required/disabled, based on $formElement[FE_MODE]. * Set corresponding html attributes readonly/required/disabled, based on $formElement[FE_MODE].
* *
* @param string $feMode * @param string $feMode
*
* @param bool $cssDisable * @param bool $cssDisable
* @param string $feType
* @return string * @return string
* @throws \CodeException * @throws \CodeException
* @throws \UserFormException * @throws \UserFormException
*/ */
public static function getAttributeFeMode($feMode, $cssDisable = true) { public static function getAttributeFeMode($feMode, $cssDisable = true, $feType = null) {
$attribute = ''; $attribute = '';
self::getFeMode($feMode, $hidden, $disabled, $required); self::getFeMode($feMode, $hidden, $disabled, $required);
...@@ -739,7 +739,10 @@ EOF; ...@@ -739,7 +739,10 @@ EOF;
$attribute .= Support::doAttribute('required', 'required'); $attribute .= Support::doAttribute('required', 'required');
break; break;
case FE_MODE_READONLY: case FE_MODE_READONLY:
$attribute .= Support::doAttribute('disabled', 'disabled');
// #18668: <button> inside disabled <fieldset> (or other element) does not register click events
$attr = ($feType === FE_TYPE_FIELDSET) ? 'readonly' : 'disabled';
$attribute .= Support::doAttribute($attr, $attr);
break; break;
default: default:
throw new \UserFormException("Unknown mode '$feMode'", ERROR_UNKNOWN_MODE); throw new \UserFormException("Unknown mode '$feMode'", ERROR_UNKNOWN_MODE);
......
...@@ -30,8 +30,12 @@ QfqNS.Helper = QfqNS.Helper || {}; ...@@ -30,8 +30,12 @@ QfqNS.Helper = QfqNS.Helper || {};
const formId = this.inputElement.closest('form.qfq-form').id; const formId = this.inputElement.closest('form.qfq-form').id;
const saveButtonId = 'save-button-' + formId; const saveButtonId = 'save-button-' + formId;
this.saveButton = document.querySelector('#' + saveButtonId); this.saveButton = document.querySelector('#' + saveButtonId);
this.saveButtonIcon = this.saveButton.querySelector('span');
this.saveButtonLabel = this.saveButton.innerText; // No save button for formModeGlobal=readonly
if(this.saveButton) {
this.saveButtonIcon = this.saveButton.querySelector('span');
this.saveButtonLabel = this.saveButton.innerText;
}
} }
const apiUrls = inputElement.getAttribute('data-api-urls'); const apiUrls = inputElement.getAttribute('data-api-urls');
......
...@@ -1725,7 +1725,8 @@ input.qfq-password { ...@@ -1725,7 +1725,8 @@ input.qfq-password {
.filepond--file-action-button { .filepond--file-action-button {
top: 6px; top: 6px;
font-size: 14px !important;; font-size: 14px !important;
cursor: pointer !important;
} }
.filepond--action-download-item > span { .filepond--action-download-item > span {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment