Commit 5d2a1bbb authored by Carsten  Rose's avatar Carsten Rose

Implements #9666: min-width for extraButtonInfo

parent f9700c9e
Pipeline #2826 passed with stages
in 2 minutes and 35 seconds
......@@ -2600,6 +2600,8 @@ Parameter
+-----------------------------+--------+----------------------------------------------------------------------------------------------------------+
| extraButtonInfoClass | string | Overwrite default from configuration_ |
+-----------------------------+--------+----------------------------------------------------------------------------------------------------------+
| extraButtonInfoMinWidth | string | See extraButtonInfo_ |
+-----------------------------+--------+----------------------------------------------------------------------------------------------------------+
| fillStoreVar | string | Fill the STORE_VAR with custom values. See `STORE_VARS`_. |
+-----------------------------+--------+----------------------------------------------------------------------------------------------------------+
| showIdInFormTitle | string | Overwrite default from configuration_ |
......@@ -3086,6 +3088,8 @@ See also at specific *FormElement* definitions.
+------------------------+--------+----------------------------------------------------------------------------------------------------------+
| extraButtonInfoClass | string | By default empty. Specify any class to be assigned to wrap extraButtonInfo |
+------------------------+--------+----------------------------------------------------------------------------------------------------------+
| extraButtonInfoMinWidth| string | See `extraButtonInfo`_ |
+------------------------+--------+----------------------------------------------------------------------------------------------------------+
| editor-plugins, | string | See `input-editor`_ |
| editor-toolbar, | | |
| editor-statusbar, | | |
......@@ -3146,9 +3150,9 @@ See also at specific *FormElement* definitions.
+------------------------+--------+----------------------------------------------------------------------------------------------------------+
| dataReference | string | Optional. See `applicationTest`_ |
+------------------------+--------+----------------------------------------------------------------------------------------------------------+
| requiredPosition | int | See requiredPosition_ . |
| requiredPosition | int | See `requiredPosition`_. |
+------------------------+--------+----------------------------------------------------------------------------------------------------------+
| minWidth | int | See checkboxRadioMinWidth . |
| minWidth | int | See `checkboxRadioMinWidth`_. |
+------------------------+--------+----------------------------------------------------------------------------------------------------------+
......@@ -3215,6 +3219,7 @@ extraButtonInfo
* `below`: below the FormElement for all types.
* `extraButtonInfoMinWidth`: default is 250 and defines a minimal width.
* For `FormElement` with mode `below`, a `span` element with the given class in `extraButtonInfoClass` (FE, F, configuration_)
will be applied. E.g. this might be `pull-right` to align the `info` button/icon on the right side below the input element.
......
......@@ -1246,6 +1246,8 @@ const FE_INPUT_EXTRA_BUTTON_LOCK = 'extraButtonLock';
const FE_INPUT_EXTRA_BUTTON_PASSWORD = 'extraButtonPassword';
const FE_INPUT_EXTRA_BUTTON_INFO = 'extraButtonInfo';
const FE_INPUT_EXTRA_BUTTON_INFO_CLASS = SYSTEM_EXTRA_BUTTON_INFO_CLASS;
const FE_INPUT_EXTRA_BUTTON_INFO_MIN_WIDTH = 'extraButtonMinWidth';
const FE_INPUT_EXTRA_BUTTON_INFO_MIN_WIDTH_DEFAULT = '250';
const FE_INPUT_AUTOCOMPLETE = 'autocomplete';
const FE_TMP_EXTRA_BUTTON_HTML = '_extraButtonHtml'; // will be filled on the fly during building extrabutton
const FE_CHECKBOX_CHECKED = 'checked';
......
......@@ -291,6 +291,7 @@ class HelperFormElement {
}
Support::setIfNotSet($feSpecNative[$key], F_FE_REQUIRED_POSITION, $formSpec[F_FE_REQUIRED_POSITION]);
Support::setIfNotSet($feSpecNative[$key], F_FE_MIN_WIDTH, $formSpec[F_FE_MIN_WIDTH]);
Support::setIfNotSet($feSpecNative[$key], FE_INPUT_EXTRA_BUTTON_INFO_MIN_WIDTH, $formSpec[FE_INPUT_EXTRA_BUTTON_INFO_MIN_WIDTH]);
}
return $feSpecNative;
......@@ -377,8 +378,11 @@ class HelperFormElement {
}
$formElement[FE_TMP_EXTRA_BUTTON_HTML] = '';
$minWidth = $formElement[FE_INPUT_EXTRA_BUTTON_INFO_MIN_WIDTH] ?? '';
$minWidth .= 'px';
// INFO: $showinline =- TRUE ('input' elemente)
// INFO: $showinline =- TRUE ('input' elements)
if (isset($formElement[FE_INPUT_EXTRA_BUTTON_INFO]) && $showInline) {
$extraButton .= <<<EOF
<button type="button" class="btn btn-info" onclick="$('#$id-extra-info').slideToggle('swing')">
......@@ -388,7 +392,7 @@ EOF;
$value = $formElement[FE_INPUT_EXTRA_BUTTON_INFO];
$formElement[FE_INPUT_EXTRA_BUTTON_INFO] = <<<EOF
<div class="alert alert-info" id="$id-extra-info" style="display: none;">
<div class="alert alert-info" id="$id-extra-info" style="display: none; min-width: $minWidth;">
<p>$value</p>
</div>
EOF;
......@@ -400,7 +404,7 @@ EOF;
$arr = explode(' ', $infoSymbolOutside, 2);
$infoSymbolOutside = $arr[0] . $js . $arr[1];
// INFO: $showinline == FALSE (e.g. 'textarea' elemente)
// INFO: $showinline == FALSE (e.g. 'textarea' elements)
if (isset($formElement[FE_INPUT_EXTRA_BUTTON_INFO]) && !$showInline) {
$class = $formElement[FE_INPUT_EXTRA_BUTTON_INFO_CLASS];
$extraButton .= <<<EOF
......@@ -409,7 +413,7 @@ EOF;
$value = $formElement[FE_INPUT_EXTRA_BUTTON_INFO];
$formElement[FE_INPUT_EXTRA_BUTTON_INFO] = <<<EOF
<div class="alert alert-info" id="$id-extra-info" style="display: none;">
<div class="alert alert-info" id="$id-extra-info" style="display: none; min-width: $minWidth;">
<p>$value</p>
</div>
EOF;
......
......@@ -1441,6 +1441,7 @@ class QuickFormQuery {
Support::setIfNotSet($formSpec, F_FE_REQUIRED_POSITION, F_FE_REQUIRED_POSITION_LABEL_RIGHT);
Support::setIfNotSet($formSpec, F_MULTI_MSG_NO_RECORD, F_MULTI_MSG_NO_RECORD_TEXT);
Support::setIfNotSet($formSpec, F_FE_MIN_WIDTH, F_FE_MIN_WIDTH_DEFAULT);
Support::setIfNotSet($formSpec, FE_INPUT_EXTRA_BUTTON_INFO_MIN_WIDTH, FE_INPUT_EXTRA_BUTTON_INFO_MIN_WIDTH_DEFAULT);
// In case there is no F_MODE defined on the form, check if there is one in STORE_SIP.
if ($formSpec[F_MODE] == '') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment