Skip to content

Commit

Permalink
Add support for nested forms embedded in tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
iliajie committed May 11, 2024
1 parent 04523fd commit 0c8777a
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion gray-theme/theme.pl
Original file line number Diff line number Diff line change
Expand Up @@ -949,11 +949,28 @@ sub theme_ui_hidden_javascript
'<img src=$imgdir/lc2.gif alt=""></td>'+
'<td class=\\'tabSelected\\' nowrap>'+
'&nbsp;<b>'+title+'</b>&nbsp;</td>'+
'<td valign=top class=\\'tabSelected\\'>'+
'<td valign=top class=\\'tabSelected\\'>'+
'<img src=$imgdir/rc2.gif alt=""></td>'+
'</tr></table>';
divobj.className = 'opener_shown';
try {
var nestedForm = divobj.querySelector("form[data-form-nested]");
if (nestedForm) {
var nestedFormId = nestedForm.getAttribute("data-form-nested"),
formSubmitters = document
.querySelectorAll(
"[data-submit-nested='" + nestedFormId + "']");
if (formSubmitters) {
formSubmitters.forEach(function(submitter) {
submitter.setAttribute(
"form", nestedForm.getAttribute('id'));
});
}
}
} catch(e) {
console.warn('Cannot set the related submitter ID of the nested form : ' + e);
}
}
else {
// Non-selected tab
tabobj.innerHTML = '<table cellpadding=0 cellspacing=0><tr>'+
Expand Down

0 comments on commit 0c8777a

Please sign in to comment.