XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFESpaceNinjaServer

chore(webui): assume deleting items will always succeed (#1731)

instead of waiting for a response + then refreshing inventory, we can just delete the element right away and hope it works out Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1731 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>

e59bdcdf
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

1 个文件 +4 -4
Modified static/webui/script.js +4 -4
@@ -487,6 +487,7 @@ function updateInventory() {
487 487 a.href = "#";
488 488 a.onclick = function (event) {
489 489 event.preventDefault();
490 document.getElementById(category + "-list").removeChild(tr);
490 491 disposeOfGear(category, item.ItemId.$oid);
491 492 };
492 493 a.title = loc("code_remove");
@@ -683,6 +684,7 @@ function updateInventory() {
683 684 a.href = "#";
684 685 a.onclick = function (event) {
685 686 event.preventDefault();
687 document.getElementById("riven-list").removeChild(tr);
686 688 disposeOfGear("Upgrades", item.ItemId.$oid);
687 689 };
688 690 a.title = loc("code_remove");
@@ -723,6 +725,7 @@ function updateInventory() {
723 725 a.href = "#";
724 726 a.onclick = function (event) {
725 727 event.preventDefault();
728 document.getElementById("mods-list").removeChild(tr);
726 729 disposeOfGear("Upgrades", item.ItemId.$oid);
727 730 };
728 731 a.title = loc("code_remove");
@@ -765,6 +768,7 @@ function updateInventory() {
765 768 a.href = "#";
766 769 a.onclick = function (event) {
767 770 event.preventDefault();
771 document.getElementById("mods-list").removeChild(tr);
768 772 disposeOfItems("Upgrades", item.ItemType, item.ItemCount);
769 773 };
770 774 a.title = loc("code_remove");
@@ -1097,8 +1101,6 @@ function disposeOfGear(category, oid) {
1097 1101 url: "/api/sell.php?" + window.authz,
1098 1102 contentType: "text/plain",
1099 1103 data: JSON.stringify(data)
1100 }).done(function () {
1101 updateInventory();
1102 1104 });
1103 1105 });
1104 1106 }
@@ -1120,8 +1122,6 @@ function disposeOfItems(category, type, count) {
1120 1122 url: "/api/sell.php?" + window.authz,
1121 1123 contentType: "text/plain",
1122 1124 data: JSON.stringify(data)
1123 }).done(function () {
1124 updateInventory();
1125 1125 });
1126 1126 });
1127 1127 }