mirror of
https://github.com/webmin/webmin.git
synced 2026-10-21 11:40:40 +01:00
Merge pull request #2864 from webmin/dev/fix-button-row-forms
Fix button row forms crossing table rows
This commit is contained in:
@@ -613,7 +613,14 @@ tr.ui_buttons_row > td {
|
||||
border-top: 1px solid var(--border-color-lighter);
|
||||
vertical-align: middle;
|
||||
}
|
||||
tr.ui_buttons_row:first-child > td { border-top: 0; }
|
||||
/* Each row is a form with a table of its own, as a form cannot wrap table
|
||||
* rows. Flattening the wrappers lets all rows share the outer columns */
|
||||
tr.ui_buttons_form_row,
|
||||
tr.ui_buttons_form_row > td,
|
||||
form.ui_buttons_form,
|
||||
form.ui_buttons_form > table,
|
||||
form.ui_buttons_form > table > tbody { display: contents; }
|
||||
tr.ui_buttons_form_row:first-child tr.ui_buttons_row > td { border-top: 0; }
|
||||
td.ui_buttons_label {
|
||||
width: 1%;
|
||||
padding-right: 16px;
|
||||
|
||||
11
ui-lib.pl
11
ui-lib.pl
@@ -1880,8 +1880,13 @@ $postmethod ||= 'post';
|
||||
if (ref($hiddens)) {
|
||||
$hiddens = join("\n", map { &ui_hidden(@$_) } @$hiddens);
|
||||
}
|
||||
return "<form action='$script' class='ui_buttons_form' method='$postmethod'>\n".
|
||||
|
||||
# A form cannot wrap table rows, so each row is a full-width cell holding
|
||||
# the form, which wraps a table of its own
|
||||
return "<tr class='ui_buttons_form_row'><td colspan='2' style='padding:0'>\n".
|
||||
"<form action='$script' class='ui_buttons_form' method='$postmethod'>\n".
|
||||
$hiddens.
|
||||
"<table width='100%' cellspacing='0'>\n".
|
||||
"<tr class='ui_buttons_row".($disabled ? " disabled" : "")."'> ".
|
||||
"<td nowrap".($singlecell ? " colspan='2'" : " width='20%'").
|
||||
" valign='top' class='ui_buttons_label'>".
|
||||
@@ -1892,7 +1897,9 @@ return "<form action='$script' class='ui_buttons_form' method='$postmethod'>\n".
|
||||
"<td width='80%' valign='top' class='ui_buttons_value'>".
|
||||
$desc."</td>\n").
|
||||
"</tr>\n".
|
||||
"</form>\n";
|
||||
"</table>\n".
|
||||
"</form>\n".
|
||||
"</td></tr>\n";
|
||||
}
|
||||
|
||||
=head2 ui_buttons_hr([title])
|
||||
|
||||
Reference in New Issue
Block a user