js: Improve rejection of autorefresh responses
Don't reject autorefreshes if an autosubmit element is focused but not interacted with fixes #4996
This commit is contained in:
parent
a48a6ebcb5
commit
6964bd19a2
|
@ -78,13 +78,13 @@
|
|||
return null;
|
||||
}
|
||||
|
||||
var origFocus = document.activeElement;
|
||||
var containerId = $container.attr('id');
|
||||
if ($container.has(origFocus).length
|
||||
&& $(origFocus).length
|
||||
&& ! $(origFocus).hasClass('autofocus')
|
||||
&& $(origFocus).closest('form').length
|
||||
&& $(origFocus).not(':input[type=button], :input[type=submit], :input[type=reset]').length
|
||||
const origFocus = document.activeElement;
|
||||
const containerId = $container.attr('id');
|
||||
if ($container[0].contains(origFocus)
|
||||
&& origFocus.form
|
||||
&& ! origFocus.matches(
|
||||
'input[type=submit], input[type=reset], input[type=button], .autofocus, .autosubmit:not(:hover)'
|
||||
)
|
||||
) {
|
||||
this.icinga.logger.debug('Not changing content for ' + containerId + ' form has focus');
|
||||
return null;
|
||||
|
|
Loading…
Reference in New Issue