Disable inventory use buttons to prevent multi-click and error

This commit is contained in:
Skylar Ittner 2016-08-21 00:07:07 -06:00
parent 6744ec52dc
commit e2556f27e4
6 changed files with 4 additions and 2 deletions

View File

@ -8,6 +8,7 @@
<script>
function useitem(uuid) {
$('#invitem-' + uuid).prop('onclick',null).off('click');
$.getJSON(mkApiUrl('useitem', 'gs'), {
itemuuid: uuid
}, function (data) {
@ -28,7 +29,7 @@
<h4 class='itemname'>" + item.itemname + "</h4>\
<p class='itemdesc'>" + item.itemdesc + "</p>";
if (item.classname == "healmagic") {
itemhtml += "<span class='btn btn-success' onclick=\"useitem('" + item.itemuuid + "')\">\
itemhtml += "<span class='btn btn-success' id='invitem-" + item.itemuuid + "' onclick=\"useitem('" + item.itemuuid + "')\">\
Use Item\
</span>";
}

View File

@ -8,6 +8,7 @@
<script>
function useitem(uuid) {
$('#invitem-' + uuid).prop('onclick',null).off('click');
$.getJSON(mkApiUrl('useitem', 'gs'), {
itemuuid: uuid
}, function (data) {
@ -28,7 +29,7 @@
<h4 class='itemname'>" + item.itemname + "</h4>\
<p class='itemdesc'>" + item.itemdesc + "</p>";
if (item.classname == "healmagic") {
itemhtml += "<span class='btn btn-success' onclick=\"useitem('" + item.itemuuid + "')\">\
itemhtml += "<span class='btn btn-success' id='invitem-" + item.itemuuid + "' onclick=\"useitem('" + item.itemuuid + "')\">\
Use Item\
</span>";
}