Commit 0e95c572 authored by Elias Villiger's avatar Elias Villiger
Browse files

Make readonly BS radio buttons non-selectable

parent 8eefcd79
......@@ -2157,6 +2157,7 @@ abstract class AbstractBuildForm {
$html = '';
for ($ii = 0; $ii < count($itemValue); $ii++) {
$classActive = '';
$classReadonly = '';
$attribute .= Support::doAttribute('value', $itemKey[$ii], false); // Always set value, even to '' - #3832
$attribute .= Support::doAttribute('title', $formElement[FE_TOOLTIP]);
......@@ -2166,13 +2167,21 @@ abstract class AbstractBuildForm {
$classActive = ' active';
}
if ($formElement[FE_MODE] == FE_MODE_READONLY) {
$classReadonly = ' noclick';
if ($itemKey[$ii] != $value) {
$classReadonly .= ' disabled';
}
}
if ($itemValue[$ii] == '') { // In case the value is empty, the rendered button looks bad. Set '&nbsp;'.
$itemValue[$ii] = '&nbsp;';
}
$htmlElement = '<input ' . $attribute . '>' . $itemValue[$ii];
$htmlElement = Support::wrapTag("<label class='btn " . $formElement[FE_BUTTON_CLASS] . "$classActive'>", $htmlElement);
$htmlElement = Support::wrapTag("<label class='btn " . $formElement[FE_BUTTON_CLASS] .
"$classReadonly$classActive'>", $htmlElement);
$html .= $htmlElement;
......
......@@ -334,6 +334,6 @@ i.@{spinner_class} {
}
}
a.noclick {
.noclick {
pointer-events: none;
}
}
\ No newline at end of file
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