push tout

This commit is contained in:
Florian Ehr 2021-02-19 13:02:14 +01:00
parent c1eee4227e
commit 3cdfffab3c
2 changed files with 23 additions and 15 deletions

View file

@ -1,3 +1,11 @@
body {
-webkit-user-select: none;
-webkit-touch-callout: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.home{ .home{
flex:1; flex:1;
height:100%; height:100%;

View file

@ -134,21 +134,21 @@ export default class Stock extends React.Component {
} }
} }
plusQuantity = (element,id) => { plusQuantity = (element,id) => {
let index = this.getArticleById(id).i; let index = this.getArticleById(id).i;
let articles = this.state.articles; let articles = this.state.articles;
articles[index].quantity++; articles[index].quantity++;
console.log(articles[index]); console.log(articles[index]);
this.setState({articles:articles},()=>{ this.setState({articles:articles},()=>{
this.updateArticle(index,id); this.updateArticle(index,id);
if (this.state.articles[index].quantity > 0 ){ if (this.state.articles[index].quantity > 0 ){
if (this.state.articles[index].selected){ if (this.state.articles[index].selected){
this.colorArticle("white",element) this.colorArticle("white",element)
} else { } else {
this.colorArticle("grey",element) this.colorArticle("grey",element)
} }
} }
}) })
} }
minusQuantity = (element,id) => { minusQuantity = (element,id) => {