summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-10-23 11:48:12 +0200
committerMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-10-23 11:48:12 +0200
commit091f77ab08b56212989d46c2b37bf837ebdf83f9 (patch)
tree8abbbb5efdb09f3549de5ee5fe6919801e5e2e69
parent4284097f9cf8f94f91ee4fd474fc284ad561cb7c (diff)
downloadalgeria-091f77ab08b56212989d46c2b37bf837ebdf83f9.tar.gz
remove animation bounce
-rw-r--r--play.js13
1 files changed, 6 insertions, 7 deletions
diff --git a/play.js b/play.js
index 1dbbf7a..baf1adf 100644
--- a/play.js
+++ b/play.js
@@ -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 {