js: Don't force focus in multipart updates if focus isn't affected

This commit is contained in:
Johannes Meyer 2020-10-28 16:07:12 +01:00
parent 1f77414a93
commit 4ce9165f77
1 changed files with 9 additions and 1 deletions

View File

@ -767,12 +767,20 @@
if (!! match) {
var $target = $('#' + match[1]);
if ($target.length) {
var forceFocus;
if (req.forceFocus
&& typeof req.forceFocus.jquery !== 'undefined'
&& $.contains($target[0], req.forceFocus[0])
) {
forceFocus = req.forceFocus;
}
_this.renderContentToContainer(
match[2],
$target,
'replace',
req.autorefresh,
req.forceFocus,
forceFocus,
autoSubmit,
req.scripted
);