Commit cba1abd2 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Merge branch 'B4765-tooltip-for-checkbox-label2' into 'master'

B4765 - Extend tooltip visibility for checkboxes and radio buttons - refs #4765, closes #4765

See merge request !103
parents b11b2ac9 677787e1
Pipeline #1013 canceled with stage
...@@ -1758,7 +1758,6 @@ abstract class AbstractBuildForm { ...@@ -1758,7 +1758,6 @@ abstract class AbstractBuildForm {
$attribute .= Support::doAttribute('id', $formElement[FE_HTML_ID]); $attribute .= Support::doAttribute('id', $formElement[FE_HTML_ID]);
$attribute .= Support::doAttribute('name', $htmlFormElementName); $attribute .= Support::doAttribute('name', $htmlFormElementName);
$attribute .= Support::doAttribute('value', $formElement[FE_CHECKBOX_CHECKED], false); $attribute .= Support::doAttribute('value', $formElement[FE_CHECKBOX_CHECKED], false);
$attribute .= Support::doAttribute('title', $formElement[FE_TOOLTIP]);
$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(FE_INPUT_AUTOCOMPLETE, 'off'); $attribute .= Support::doAttribute(FE_INPUT_AUTOCOMPLETE, 'off');
...@@ -1783,8 +1782,9 @@ abstract class AbstractBuildForm { ...@@ -1783,8 +1782,9 @@ abstract class AbstractBuildForm {
$htmlElement .= $formElement['checked']; $htmlElement .= $formElement['checked'];
} }
$html .= Support::wrapTag("<label class='btn " . $formElement[FE_BUTTON_CLASS] . "$classActive'>", $labelAttribute = Support::doAttribute('title', $formElement[FE_TOOLTIP]);
$htmlElement, true); $labelAttribute .= Support::doAttribute('class', 'btn ' . $formElement[FE_BUTTON_CLASS] . $classActive);
$html .= Support::wrapTag("<label $labelAttribute>", $htmlElement, true);
$html = Support::wrapTag('<div class="btn-group" data-toggle="buttons">', $html); $html = Support::wrapTag('<div class="btn-group" data-toggle="buttons">', $html);
$json = $this->getFormElementForJson($htmlFormElementName, $valueJson, $formElement); $json = $this->getFormElementForJson($htmlFormElementName, $valueJson, $formElement);
...@@ -1818,7 +1818,6 @@ abstract class AbstractBuildForm { ...@@ -1818,7 +1818,6 @@ abstract class AbstractBuildForm {
$attribute .= Support::doAttribute('id', $formElement[FE_HTML_ID]); $attribute .= Support::doAttribute('id', $formElement[FE_HTML_ID]);
$attribute .= Support::doAttribute('name', $htmlFormElementName); $attribute .= Support::doAttribute('name', $htmlFormElementName);
$attribute .= Support::doAttribute('value', $formElement[FE_CHECKBOX_CHECKED], false); $attribute .= Support::doAttribute('value', $formElement[FE_CHECKBOX_CHECKED], false);
$attribute .= Support::doAttribute('title', $formElement[FE_TOOLTIP]);
$attribute .= Support::doAttribute('data-load', ($formElement[FE_DYNAMIC_UPDATE] === 'yes') ? 'data-load' : ''); $attribute .= Support::doAttribute('data-load', ($formElement[FE_DYNAMIC_UPDATE] === 'yes') ? 'data-load' : '');
if ($formElement[FE_CHECKBOX_CHECKED] === $value) { if ($formElement[FE_CHECKBOX_CHECKED] === $value) {
...@@ -1839,7 +1838,8 @@ abstract class AbstractBuildForm { ...@@ -1839,7 +1838,8 @@ abstract class AbstractBuildForm {
$html .= $formElement['label2']; $html .= $formElement['label2'];
} }
$html = Support::wrapTag("<label>", $html, true); $labelAttribute = Support::doAttribute('title', $formElement[FE_TOOLTIP]);
$html = Support::wrapTag("<label $labelAttribute>", $html, true);
$html = Support::wrapTag("<div class='checkbox'>", $html, true); $html = Support::wrapTag("<div class='checkbox'>", $html, true);
$json = $this->getFormElementForJson($htmlFormElementName, $valueJson, $formElement); $json = $this->getFormElementForJson($htmlFormElementName, $valueJson, $formElement);
...@@ -2181,7 +2181,6 @@ abstract class AbstractBuildForm { ...@@ -2181,7 +2181,6 @@ abstract class AbstractBuildForm {
$attribute .= Support::doAttribute('id', $formElement[FE_HTML_ID] . '-' . $ii); $attribute .= Support::doAttribute('id', $formElement[FE_HTML_ID] . '-' . $ii);
$attribute .= Support::doAttribute('value', $itemKey[$ii], false); // Always set value, even to '' - #3832 $attribute .= Support::doAttribute('value', $itemKey[$ii], false); // Always set value, even to '' - #3832
$attribute .= Support::doAttribute('title', $formElement[FE_TOOLTIP]);
if ($itemKey[$ii] == $value) { if ($itemKey[$ii] == $value) {
$attribute .= Support::doAttribute('checked', 'checked'); $attribute .= Support::doAttribute('checked', 'checked');
...@@ -2201,8 +2200,9 @@ abstract class AbstractBuildForm { ...@@ -2201,8 +2200,9 @@ abstract class AbstractBuildForm {
$htmlElement = '<input ' . $attribute . '>' . $itemValue[$ii]; $htmlElement = '<input ' . $attribute . '>' . $itemValue[$ii];
$htmlElement = Support::wrapTag("<label class='btn " . $formElement[FE_BUTTON_CLASS] . $labelAttribute = Support::doAttribute('title', $formElement[FE_TOOLTIP]);
"$classReadonly$classActive'>", $htmlElement); $labelAttribute .= Support::doAttribute('class', 'btn ' . $formElement[FE_BUTTON_CLASS] . $classReadonly . $classActive);
$htmlElement = Support::wrapTag("<label $labelAttribute>", $htmlElement);
$html .= $htmlElement; $html .= $htmlElement;
...@@ -2273,7 +2273,6 @@ abstract class AbstractBuildForm { ...@@ -2273,7 +2273,6 @@ abstract class AbstractBuildForm {
$attribute .= Support::doAttribute('id', $formElement[FE_HTML_ID] . '-' . $ii); $attribute .= Support::doAttribute('id', $formElement[FE_HTML_ID] . '-' . $ii);
$attribute .= Support::doAttribute('value', $itemKey[$ii], false); // Always set value, even to '' - #3832 $attribute .= Support::doAttribute('value', $itemKey[$ii], false); // Always set value, even to '' - #3832
$attribute .= Support::doAttribute('title', $formElement[FE_TOOLTIP]);
if ($itemKey[$ii] == $value) { if ($itemKey[$ii] == $value) {
$attribute .= Support::doAttribute('checked', 'checked'); $attribute .= Support::doAttribute('checked', 'checked');
...@@ -2299,7 +2298,9 @@ abstract class AbstractBuildForm { ...@@ -2299,7 +2298,9 @@ abstract class AbstractBuildForm {
} }
} }
$htmlElement = Support::wrapTag("<div class='$radioClass'>", $htmlElement) . $br; $wrapAttribute = Support::doAttribute('title', $formElement[FE_TOOLTIP]);
$wrapAttribute .= Support::doAttribute('class', $radioClass);
$htmlElement = Support::wrapTag("<div $wrapAttribute>", $htmlElement) . $br;
$html .= $htmlElement; $html .= $htmlElement;
......
Supports Markdown
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