Skip to content

Commit f424ebe

Browse files
committed
release: alpha 6.0.0
1 parent d9ca21b commit f424ebe

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

middlewares/animate.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ function onAnimationEnd (ev) {
2525
function animate (elem) {
2626
if (elem.nodeType !== 1) return
2727

28-
const root = elem.$root
29-
if (!root[secret.listening]) {
30-
root.addEventListener('animationend', onAnimationEnd, true)
31-
root[secret.listening] = true
32-
}
33-
3428
elem.$attribute('enter-animation', enterAttribute)
3529
elem.$attribute('leave-animation', leaveAttribute)
3630
elem.$attribute('move-animation', moveAttribute)
@@ -52,6 +46,7 @@ function enterAttribute (animation) {
5246
}
5347
this.style.animation = animation
5448
setAnimationDefaults(this)
49+
registerListener(this)
5550
}
5651
}
5752

@@ -61,6 +56,15 @@ function leaveAttribute (animation) {
6156
this.$cleanup(unwatch)
6257
this.$cleanup(onLeave, animation)
6358
this[secret.parent] = this.parentNode
59+
registerListener(this)
60+
}
61+
}
62+
63+
function registerListener (elem) {
64+
const root = elem.$root
65+
if (!root[secret.listening]) {
66+
root.addEventListener('animationend', onAnimationEnd, true)
67+
root[secret.listening] = true
6468
}
6569
}
6670

@@ -180,11 +184,11 @@ function setTransitionDefaults (elem) {
180184

181185
function shouldAbsolutePosition (elem) {
182186
elem = elem.parentNode
183-
while (elem) {
187+
while (elem && elem !== elem.$root) {
184188
if (elem[secret.leaving]) return false
185-
if (elem === elem.$root) return true
186189
elem = elem.parentNode
187190
}
191+
return true
188192
}
189193

190194
function toAbsolutePosition (elem) {

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@risingstack/nx-framework",
3-
"version": "1.0.0-alpha.5.0.0",
3+
"version": "1.0.0-alpha.6.0.0",
44
"description": "Next generation client side framework",
55
"main": "index.js",
66
"author": {
@@ -29,8 +29,8 @@
2929
"data binding"
3030
],
3131
"dependencies": {
32-
"@risingstack/nx-compile": "^4.1.0",
33-
"@risingstack/nx-observe": "^2.0.1",
32+
"@risingstack/nx-compile": "^4.2.0",
33+
"@risingstack/nx-observe": "^2.0.4",
3434
"keycode": "^2.1.4"
3535
},
3636
"devDependencies": {

0 commit comments

Comments
 (0)