aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralexichi <alexbankai96@gmail.com>2016-05-07 17:54:54 +0200
committeralexichi <alexbankai96@gmail.com>2016-05-07 17:54:54 +0200
commit3795b462a30a1942f5ebac3105e72824acbd1a87 (patch)
treea21ad4adee4749e4eff6f75b2f19fd6d0d10fcd3
parentf5f13ebb900746c942d339149a838b6c8ef0586d (diff)
downloadcandybox-3795b462a30a1942f5ebac3105e72824acbd1a87.tar.gz
candybox-3795b462a30a1942f5ebac3105e72824acbd1a87.tar.bz2
candybox-3795b462a30a1942f5ebac3105e72824acbd1a87.tar.xz
candybox-3795b462a30a1942f5ebac3105e72824acbd1a87.zip
add id to item in order to change the value client side
-rw-r--r--js/shop.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/js/shop.js b/js/shop.js
index ce0ecd8..053f7c8 100644
--- a/js/shop.js
+++ b/js/shop.js
@@ -35,7 +35,7 @@ function addItem(ret) {
var itemtag = document.querySelector("[data-name=\""+ret[0].name+"\"]");
if(!itemtag){ //si c'est la première itération de l'objet
itemhtml += "<li>";
- itemhtml += "<button type=\"button\" class=\"btn btn-success\" onclick=\"useItem('" + ret[0].name + "')\"><span class=\"item-icon\">" + ret[0].icon + "</span><br />" + ret[0].name + "(<span data-name=\""+ ret[0].name + "\">"+ret[1]+"</span>)</button>";
+ itemhtml += "<button type=\"button\" class=\"btn btn-success\" onclick=\"useItem('" + ret[0].name + "')\"><span class=\"item-icon\">" + ret[0].icon + "</span><br />" + ret[0].name + "(<span id=\"nbItem\" data-name=\""+ ret[0].name + "\">"+ret[1]+"</span>)</button>";
itemhtml += "</li>";
}
else{ // si c'est une n-ième itération