forked from DGNum/gestioCOF
Clean JS ajout article et ordre des articles
This commit is contained in:
parent
e154316eae
commit
1f61f79606
1 changed files with 4 additions and 6 deletions
|
@ -526,16 +526,14 @@ $(document).ready(function() {
|
|||
});
|
||||
if (!added) articles_container.append(category_html);
|
||||
}
|
||||
var added = false;
|
||||
var $after = articles_container.find('#data-category-'+article['category_id']);
|
||||
articles_container
|
||||
.find('.article.data-category-'+article['category_id']).each(function() {
|
||||
if (article['name'].toLowerCase < $('.name', this).text().toLowerCase()) {
|
||||
$(this).before(article_html);
|
||||
added = true;
|
||||
if (article['name'].toLowerCase < $('.name', this).text().toLowerCase())
|
||||
return false;
|
||||
}
|
||||
$after = $(this);
|
||||
});
|
||||
if (!added) articles_container.find('#data-category-'+article['category_id']).after(article_html);
|
||||
$after.after(article_html);
|
||||
// Pour l'autocomplétion
|
||||
articlesList.push([article['name'],article['id'],article['category_id'],article['price']]);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue