diff options
author | Mischa Untaga <99098079+MischaU8@users.noreply.github.com> | 2023-10-23 11:48:12 +0200 |
---|---|---|
committer | Mischa Untaga <99098079+MischaU8@users.noreply.github.com> | 2023-10-23 11:48:12 +0200 |
commit | 091f77ab08b56212989d46c2b37bf837ebdf83f9 (patch) | |
tree | 8abbbb5efdb09f3549de5ee5fe6919801e5e2e69 | |
parent | 4284097f9cf8f94f91ee4fd474fc284ad561cb7c (diff) | |
download | algeria-091f77ab08b56212989d46c2b37bf837ebdf83f9.tar.gz |
remove animation bounce
-rw-r--r-- | play.js | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -519,6 +519,8 @@ function update_unit(e, u) { } Node.prototype.appendChildAnimated = function(e) { + if (this.contains(e)) + return const { left: x0, top: y0 } = e.getBoundingClientRect() this.appendChild(e) if (!x0) @@ -575,23 +577,20 @@ function update_map() { if (loc) { if (loc === DEPLOY) { - if (is_gov_unit(u) && !ui.gov_supply.contains(e)) + if (is_gov_unit(u)) ui.gov_supply.appendChildAnimated(e) - if (is_fln_unit(u) && !ui.fln_supply.contains(e)) + if (is_fln_unit(u)) ui.fln_supply.appendChildAnimated(e) } else if (loc === ELIMINATED) { - if (!ui.eliminated.contains(e)) - ui.eliminated.appendChildAnimated(e) + ui.eliminated.appendChildAnimated(e) } else { let box_id = unit_box(u) if (is_area_country(loc)) { // only single box in France, Morocco and Tunisia box_id = 0 } - if (!ui.boxes[loc * 4 + box_id].contains(e)) { - ui.boxes[loc * 4 + box_id].appendChildAnimated(e) - } + ui.boxes[loc * 4 + box_id].appendChildAnimated(e) } update_unit(e, u) } else { |