Skip to content
Snippets Groups Projects
Commit 5d64b1b4 authored by Benoit Alessandroni's avatar Benoit Alessandroni
Browse files

Fixing useless calls to refresh pagination

parent 1ec9e96a
No related branches found
No related tags found
1 merge request!158Fixing useless calls to refresh pagination
Pipeline #5765 failed with stage
in 1 hour
......@@ -246,34 +246,28 @@ function InitManagementForType() {
var forms = document.querySelectorAll(".resource_by_step");
forms.forEach(form => {
form.addEventListener(
"populate",
e => {
window.setTimeout(() => {
let type_hidden_field = form.querySelectorAll('select[name="type"]');
type_hidden_field.forEach(function(select_hidden) {
options_hidden = select_hidden.getElementsByTagName("option");
for (let option_hidden of options_hidden) {
option_hidden.removeAttribute("selected");
str = option_hidden.value
if (str.substr(str.length - 10) == 'types/1/"}') {
//Actually selecting the option if it is the good one
option_hidden.setAttribute("selected", "selected");
select_hidden.setAttribute("value", option_hidden.value);
}
}
//Trigerring a reload of the associated form
let parent_form = select_hidden.closest("sib-form");
parent_form.component.inputChange();
parent_form.dispatchEvent(new CustomEvent('formChange'));
refreshPagination();
});
});
},
3000
);
form.addEventListener("populate", e => {
let type_hidden_field = form.querySelectorAll('select[name="type"]');
type_hidden_field.forEach(function(select_hidden) {
options_hidden = select_hidden.getElementsByTagName("option");
for (let option_hidden of options_hidden) {
option_hidden.removeAttribute("selected");
str = option_hidden.value
if (str.substr(str.length - 10) == 'types/1/"}') {
//Actually selecting the option if it is the good one
option_hidden.setAttribute("selected", "selected");
select_hidden.setAttribute("value", option_hidden.value);
}
}
//Trigerring a reload of the associated form
let parent_form = select_hidden.closest("sib-form");
parent_form.component.inputChange();
parent_form.dispatchEvent(new CustomEvent('formChange'));
refreshPagination();
});
});
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment