mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
form.js: Don't abort content updates in case of auto submits
This commit is contained in:
parent
f2e53d420b
commit
defd8132aa
@ -40,10 +40,11 @@
|
|||||||
* @param $container {jQuery} The target container where the html will be rendered in
|
* @param $container {jQuery} The target container where the html will be rendered in
|
||||||
* @param action {String} The action-url that caused the reload
|
* @param action {String} The action-url that caused the reload
|
||||||
* @param autorefresh {Boolean} Whether the rendering is due to an autoRefresh
|
* @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
|
* @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') {
|
if ($container.attr('id') === 'menu') {
|
||||||
var $search = $container.find('#search');
|
var $search = $container.find('#search');
|
||||||
if ($search[0] === document.activeElement) {
|
if ($search[0] === document.activeElement) {
|
||||||
@ -57,7 +58,7 @@
|
|||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! autorefresh) {
|
if (! autorefresh || autoSubmit) {
|
||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1167,7 +1167,7 @@
|
|||||||
var discard = false;
|
var discard = false;
|
||||||
$.each(_this.icinga.behaviors, function(name, behavior) {
|
$.each(_this.icinga.behaviors, function(name, behavior) {
|
||||||
if (behavior.renderHook) {
|
if (behavior.renderHook) {
|
||||||
var changed = behavior.renderHook(content, $container, action, autorefresh);
|
var changed = behavior.renderHook(content, $container, action, autorefresh, autoSubmit);
|
||||||
if (changed === null) {
|
if (changed === null) {
|
||||||
discard = true;
|
discard = true;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user