Hotfixed error where SPD would not be updated on load if it was manually inserted.

This commit is contained in:
Yord 2016-04-10 10:57:26 +02:00
parent f15cbfafc7
commit 9a66b998ed
2 changed files with 23 additions and 2 deletions

View file

@ -1,5 +1,5 @@
CACHE MANIFEST CACHE MANIFEST
# 2016-03-12 # 2016-04-10
CACHE: CACHE:

View file

@ -1515,10 +1515,31 @@ var ikrpg = ikrpg || {};
var spdMod = parseInt($(".character-sheet #wornarmor1 .spd").val()) || 0; var spdMod = parseInt($(".character-sheet #wornarmor1 .spd").val()) || 0;
$(".character-sheet #spd").val(computedSpd - spdMod); $(".character-sheet #spd").val(computedSpd - spdMod);
}) });
})(); })();
// ### Update computed SPD (on load) ### \\ HACK!
(function() {
setTimeout(function() {
$("#characters > tbody > tr > td:nth-of-type(5) > a").click(function(event) {
event.preventDefault();
var a = $(event.target);
var tr = a.parent().parent();
var name = tr.find("td:nth-of-type(1)").text();
ikrpg.sheet.showCharacter(name);
setTimeout(function() { // HACK! (problem seems to be that pouch db is async loading)
var spd = $(".character-sheet #spd").val() || 0;
$(".character-sheet #computed-spd").val(spd);
}, 500);
});
}, 500);
})();
})(); })();
// ## Ability changes ## \\ // ## Ability changes ## \\