Commit 59bb00af authored by Mat's avatar Mat

Lettre sorted, ajoute l'offre à la fin de la lettre qd elle n'est pas déjà définie

+ [DEBUG] confondait .ui-state-default de l'offre ou de la lettre
parent b0c49d46
...@@ -183,6 +183,12 @@ class LettreAPIController extends MasterAPIController ...@@ -183,6 +183,12 @@ class LettreAPIController extends MasterAPIController
// Récupère l'ordre de tri // Récupère l'ordre de tri
$sorted = $em->getRepository('PotageBundle:Lettre')->findOneForSorted($id)->getSorted(); $sorted = $em->getRepository('PotageBundle:Lettre')->findOneForSorted($id)->getSorted();
$arraySorted = explode(',', $sorted);
if (!in_array("-1", $arraySorted)) {
array_push($arraySorted, "-1");
$sorted = implode(",", $arraySorted);
}
return $this->api($sorted); return $this->api($sorted);
} }
......
...@@ -120,7 +120,7 @@ if (sortForm) ...@@ -120,7 +120,7 @@ if (sortForm)
sortForm.addEventListener('submit', function(e) sortForm.addEventListener('submit', function(e)
{ {
let list = []; let list = [];
let items = document.querySelectorAll('.ui-state-default'); let items = document.querySelectorAll('.ui-state-default.info');
for (let i=0; i < items.length; i++) for (let i=0; i < items.length; i++)
{ {
list[i] = items[i].dataset.infoId; list[i] = items[i].dataset.infoId;
......
...@@ -336,7 +336,7 @@ function countLegumes(lettre) ...@@ -336,7 +336,7 @@ function countLegumes(lettre)
*/ */
function buildItemOffreLegumes(jsonRow) function buildItemOffreLegumes(jsonRow)
{ {
console.log(jsonRow); //console.log(jsonRow);
let div = document.createElement('div'); let div = document.createElement('div');
div.classList.add('ui-state-default', 'legume'); div.classList.add('ui-state-default', 'legume');
......
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