Disable inventory use buttons to prevent multi-click and error
This commit is contained in:
parent
6744ec52dc
commit
e2556f27e4
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
function useitem(uuid) {
|
function useitem(uuid) {
|
||||||
|
$('#invitem-' + uuid).prop('onclick',null).off('click');
|
||||||
$.getJSON(mkApiUrl('useitem', 'gs'), {
|
$.getJSON(mkApiUrl('useitem', 'gs'), {
|
||||||
itemuuid: uuid
|
itemuuid: uuid
|
||||||
}, function (data) {
|
}, function (data) {
|
||||||
@ -28,7 +29,7 @@
|
|||||||
<h4 class='itemname'>" + item.itemname + "</h4>\
|
<h4 class='itemname'>" + item.itemname + "</h4>\
|
||||||
<p class='itemdesc'>" + item.itemdesc + "</p>";
|
<p class='itemdesc'>" + item.itemdesc + "</p>";
|
||||||
if (item.classname == "healmagic") {
|
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\
|
Use Item\
|
||||||
</span>";
|
</span>";
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
function useitem(uuid) {
|
function useitem(uuid) {
|
||||||
|
$('#invitem-' + uuid).prop('onclick',null).off('click');
|
||||||
$.getJSON(mkApiUrl('useitem', 'gs'), {
|
$.getJSON(mkApiUrl('useitem', 'gs'), {
|
||||||
itemuuid: uuid
|
itemuuid: uuid
|
||||||
}, function (data) {
|
}, function (data) {
|
||||||
@ -28,7 +29,7 @@
|
|||||||
<h4 class='itemname'>" + item.itemname + "</h4>\
|
<h4 class='itemname'>" + item.itemname + "</h4>\
|
||||||
<p class='itemdesc'>" + item.itemdesc + "</p>";
|
<p class='itemdesc'>" + item.itemdesc + "</p>";
|
||||||
if (item.classname == "healmagic") {
|
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\
|
Use Item\
|
||||||
</span>";
|
</span>";
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user