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

Committing useless and harsh method

parent b9c0726b
No related branches found
No related tags found
1 merge request!127Committing useless and harsh method
Pipeline #3869 passed with stage
in 2 minutes
......@@ -209,36 +209,36 @@ function selectHiddenManagementForType(tab, form) {
/**
* Init type to type 1
*/
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");
if (option_hidden.value == '{"@id": "http://localhost:8000/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();
refreshPagination();
});
});
},
3000
);
});
}
// 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");
// if (option_hidden.value == '{"@id": "http://localhost:8000/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();
// refreshPagination();
// });
// });
// },
// 3000
// );
// });
// }
/**
* Manage the report broken links hidden form
......@@ -609,7 +609,7 @@ jQuery(document).ready(function($) {
refreshPagination();
//init the fitering by step
InitManagementForType();
// InitManagementForType();
// Get the element with id="defaultOpen" and click on it
document.getElementById("defaultOpen").click();
......
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