[Web] Do not use hard-coded params in imapsync jobs

[Web] Allow custom parameters in imapsync
This commit is contained in:
André
2018-07-27 22:19:59 +02:00
parent 1115b826f9
commit 6f656c39b4
10 changed files with 143 additions and 37 deletions

View File

@@ -80,11 +80,11 @@ $(document).ready(function() {
// If clicked element #edit_selected is in a form with the same data-id as the button,
// we merge all input fields by {"name":"value"} into api-attr
if ($(this).closest("form").data('id') == id) {
var req_empty = false;
var invalid = false;
$(this).closest("form").find('select, textarea, input').each(function() {
if ($(this).prop('required')) {
if (!$(this).val() && $(this).prop('disabled') === false) {
req_empty = true;
invalid = true;
$(this).addClass('inputMissingAttr');
} else {
$(this).removeClass('inputMissingAttr');
@@ -106,7 +106,7 @@ $(document).ready(function() {
}
}
});
if (!req_empty) {
if (!invalid) {
var attr_to_merge = $(this).closest("form").serializeObject();
var api_attr = $.extend(api_attr, attr_to_merge)
} else {