form.js: Don't abort content updates in case of auto submits

This commit is contained in:
Johannes Meyer 2021-02-09 09:13:11 +01:00
parent f2e53d420b
commit defd8132aa
2 changed files with 4 additions and 3 deletions

View File

@ -40,10 +40,11 @@
* @param $container {jQuery} The target container where the html will be rendered in
* @param action {String} The action-url that caused the reload
* @param autorefresh {Boolean} Whether the rendering is due to an autoRefresh
* @param autoSubmit {Boolean} Whether the rendering is due to an autoSubmit
*
* @returns {string|NULL} The content to be rendered, or NULL, when nothing should be changed
*/
Form.prototype.renderHook = function(content, $container, action, autorefresh) {
Form.prototype.renderHook = function(content, $container, action, autorefresh, autoSubmit) {
if ($container.attr('id') === 'menu') {
var $search = $container.find('#search');
if ($search[0] === document.activeElement) {
@ -57,7 +58,7 @@
return content;
}
if (! autorefresh) {
if (! autorefresh || autoSubmit) {
return content;
}

View File

@ -1167,7 +1167,7 @@
var discard = false;
$.each(_this.icinga.behaviors, function(name, behavior) {
if (behavior.renderHook) {
var changed = behavior.renderHook(content, $container, action, autorefresh);
var changed = behavior.renderHook(content, $container, action, autorefresh, autoSubmit);
if (changed === null) {
discard = true;
} else {