WIP: Aureplop/kpsul js refactor #501
2 changed files with 3 additions and 1 deletions
|
@ -376,6 +376,7 @@ class ArticleManager {
|
||||||
this._$container = $('#articles_data');
|
this._$container = $('#articles_data');
|
||||||
this._$input = $('#article_autocomplete');
|
this._$input = $('#article_autocomplete');
|
||||||
this._$nb = $('#article_number');
|
this._$nb = $('#article_number');
|
||||||
|
this._$stock = $('#article_stock');
|
||||||
this.templates = {'category': '<div class="category"><span class="name"></span></div>',
|
this.templates = {'category': '<div class="category"><span class="name"></span></div>',
|
||||||
'article' : '<div class="article"><span class="name"></span><span class="price"></span><span class="stock"></span></div>'}
|
'article' : '<div class="article"><span class="name"></span><span class="price"></span><span class="stock"></span></div>'}
|
||||||
|
|
||||||
|
@ -398,6 +399,7 @@ class ArticleManager {
|
||||||
this.selected.from(article) ;
|
this.selected.from(article) ;
|
||||||
this._$input.val(article.name);
|
this._$input.val(article.name);
|
||||||
this._$nb.val('1');
|
this._$nb.val('1');
|
||||||
|
this._$stock.text('/'+article.stock);
|
||||||
this._$nb.focus().select();
|
this._$nb.focus().select();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -431,6 +433,7 @@ class ArticleManager {
|
||||||
|
|
||||||
reset() {
|
reset() {
|
||||||
this.unset() ;
|
this.unset() ;
|
||||||
|
this._$stock.text('');
|
||||||
this._$nb.val('');
|
this._$nb.val('');
|
||||||
this._$input.val('');
|
this._$input.val('');
|
||||||
this.autocomplete.showAll() ;
|
this.autocomplete.showAll() ;
|
||||||
|
|
|
@ -128,7 +128,6 @@
|
||||||
<input type="text" id="article_autocomplete" autocomplete="off">
|
<input type="text" id="article_autocomplete" autocomplete="off">
|
||||||
<input type="number" id="article_number" step="1" min="1">
|
<input type="number" id="article_number" step="1" min="1">
|
||||||
<span type="stock" id="article_stock"></span>
|
<span type="stock" id="article_stock"></span>
|
||||||
<input type="hidden" id="article_id" value="">
|
|
||||||
</div>
|
</div>
|
||||||
<div id="articles_data">
|
<div id="articles_data">
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue