@endorphinjs/template-runtime
Advanced tools
Comparing version 0.1.25 to 0.1.26
@@ -2261,6 +2261,7 @@ 'use strict'; | ||
* @param {string} animation | ||
* @param {Object} scope | ||
* @param {Function} [callback] | ||
* @param {string} [cssScope] | ||
*/ | ||
function animateOut(elem$$1, animation, callback, cssScope$$1) { | ||
function animateOut(elem$$1, animation, scope, callback, cssScope$$1) { | ||
if (typeof callback === 'string') { | ||
@@ -2272,2 +2273,9 @@ cssScope$$1 = callback; | ||
if (animation = createAnimation(animation, cssScope$$1)) { | ||
// Create a copy of scope and pass it to callback function. | ||
// It’s required for proper clean-up in case if the same element | ||
// (with the same scope references) will be created during animation | ||
if (scope) { | ||
scope = assign(obj(), scope); | ||
} | ||
/** @param {AnimationEvent} evt */ | ||
@@ -2279,3 +2287,3 @@ const handler = evt => { | ||
elem$$1.removeEventListener('animationcancel', handler); | ||
dispose(elem$$1, callback); | ||
dispose(elem$$1, () => callback && callback(scope)); | ||
} | ||
@@ -2282,0 +2290,0 @@ }; |
@@ -2257,6 +2257,7 @@ /** | ||
* @param {string} animation | ||
* @param {Object} scope | ||
* @param {Function} [callback] | ||
* @param {string} [cssScope] | ||
*/ | ||
function animateOut(elem$$1, animation, callback, cssScope$$1) { | ||
function animateOut(elem$$1, animation, scope, callback, cssScope$$1) { | ||
if (typeof callback === 'string') { | ||
@@ -2268,2 +2269,9 @@ cssScope$$1 = callback; | ||
if (animation = createAnimation(animation, cssScope$$1)) { | ||
// Create a copy of scope and pass it to callback function. | ||
// It’s required for proper clean-up in case if the same element | ||
// (with the same scope references) will be created during animation | ||
if (scope) { | ||
scope = assign(obj(), scope); | ||
} | ||
/** @param {AnimationEvent} evt */ | ||
@@ -2275,3 +2283,3 @@ const handler = evt => { | ||
elem$$1.removeEventListener('animationcancel', handler); | ||
dispose(elem$$1, callback); | ||
dispose(elem$$1, () => callback && callback(scope)); | ||
} | ||
@@ -2278,0 +2286,0 @@ }; |
{ | ||
"name": "@endorphinjs/template-runtime", | ||
"version": "0.1.25", | ||
"version": "0.1.26", | ||
"description": "EndorphinJS template runtime, embedded with template bundles", | ||
@@ -5,0 +5,0 @@ "main": "./dist/runtime.cjs.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
355355
4656