Commit bd123a69 authored by Mat's avatar Mat

nettoyage indentation

parent 2b580c42
......@@ -70,65 +70,65 @@
function reloadGridImage()
{
grid.innerHTML = null;
grid.innerHTML = null;
AJAX('GET', imagesURL, function(request)
{
let json = JSON.parse(request.responseText);
for (let i = 0; i < json.length; i++)
AJAX('GET', imagesURL, function(request)
{
let div = document.createElement('div');
div.classList.add('image');
let img = document.createElement('img');
img.setAttribute('src', json[i].path);
img.setAttribute('title', json[i].name);
img.setAttribute('alt', json[i].name);
div.appendChild(img);
let modify = document.createElement('div');
modify.classList.add('modify');
let owner = document.createElement('div');
owner.classList.add('owner');
owner.innerHTML = json[i].owner.firstname + ' ' + json[i].owner.lastname;
div.appendChild(owner);
/*
* Editer une ligne du tableau (update),
* charge les données dans le formulaire
*/
let editBtn = document.createElement('button');
editBtn.classList.add('btn', 'btn-primary');
editBtn.dataset.imageId = json[i].id;
editBtn.innerHTML = '<i class="fas fa-edit fa-fw"></i> Editer';
editBtn.addEventListener('click', function(e)
let json = JSON.parse(request.responseText);
for (let i = 0; i < json.length; i++)
{
let div = document.createElement('div');
div.classList.add('image');
});
modify.appendChild(editBtn);
let img = document.createElement('img');
img.setAttribute('src', json[i].path);
img.setAttribute('title', json[i].name);
img.setAttribute('alt', json[i].name);
div.appendChild(img);
let modify = document.createElement('div');
modify.classList.add('modify');
/*
* Effacer une ligne du tableau (delete)
*/
let owner = document.createElement('div');
owner.classList.add('owner');
owner.innerHTML = json[i].owner.firstname + ' ' + json[i].owner.lastname;
div.appendChild(owner);
let deleteBtn = document.createElement('button');
deleteBtn.classList.add('btn', 'btn-danger');
deleteBtn.dataset.imageId = json[i].id;
deleteBtn.innerHTML = '<i class="fas fa-trash fa-fw"></i> Supprimer';
deleteBtn.addEventListener('click', function(e)
{
});
modify.appendChild(deleteBtn);
/*
* Editer une ligne du tableau (update),
* charge les données dans le formulaire
*/
div.appendChild(modify);
grid.appendChild(div);
}
});
let editBtn = document.createElement('button');
editBtn.classList.add('btn', 'btn-primary');
editBtn.dataset.imageId = json[i].id;
editBtn.innerHTML = '<i class="fas fa-edit fa-fw"></i> Editer';
editBtn.addEventListener('click', function(e)
{
});
modify.appendChild(editBtn);
/*
* Effacer une ligne du tableau (delete)
*/
let deleteBtn = document.createElement('button');
deleteBtn.classList.add('btn', 'btn-danger');
deleteBtn.dataset.imageId = json[i].id;
deleteBtn.innerHTML = '<i class="fas fa-trash fa-fw"></i> Supprimer';
deleteBtn.addEventListener('click', function(e)
{
});
modify.appendChild(deleteBtn);
div.appendChild(modify);
grid.appendChild(div);
}
});
}
reloadGridImage();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment