Skip to content

Commit

Permalink
chore(all): prepare release 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Sep 5, 2016
1 parent b8fdb55 commit 979194e
Show file tree
Hide file tree
Showing 9 changed files with 178 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-animator-css",
"version": "1.0.0",
"version": "1.0.1",
"description": "An implementation of the abstract Animator interface from templating which enables css-based animations.",
"keywords": [
"aurelia",
Expand Down
27 changes: 26 additions & 1 deletion dist/amd/aurelia-animator-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ define(['exports', 'aurelia-templating', 'aurelia-pal'], function (exports, _aur
}
};

CssAnimator.prototype._removeMultipleEventListener = function _removeMultipleEventListener(el, s, fn) {
var evts = s.split(' ');
for (var i = 0, ii = evts.length; i < ii; ++i) {
el.removeEventListener(evts[i], fn, false);
}
};

CssAnimator.prototype._getElementAnimationDelay = function _getElementAnimationDelay(element) {
var styl = _aureliaPal.DOM.getComputedStyle(element);
var prop = void 0;
Expand Down Expand Up @@ -111,7 +118,11 @@ define(['exports', 'aurelia-templating', 'aurelia-pal'], function (exports, _aur

try {
for (var i = 0; i < styleSheets.length; ++i) {
var cssRules = styleSheets[i].cssRules;
var cssRules = null;

try {
cssRules = styleSheets[i].cssRules;
} catch (e) {}

if (!cssRules) {
continue;
Expand Down Expand Up @@ -218,6 +229,10 @@ define(['exports', 'aurelia-templating', 'aurelia-pal'], function (exports, _aur
if (!_this4._animationChangeWithValidKeyframe(animationNames, prevAnimationNames)) {
classList.remove('au-enter-active');
classList.remove('au-enter');

_this4._removeMultipleEventListener(element, 'webkitAnimationEnd animationend', _animEnd);
_this4._removeMultipleEventListener(element, 'webkitAnimationStart animationstart', _animStart);

_this4._triggerDOMEvent(_aureliaTemplating.animationEvent.enterTimeout, element);
resolve(false);
}
Expand Down Expand Up @@ -300,6 +315,10 @@ define(['exports', 'aurelia-templating', 'aurelia-pal'], function (exports, _aur
if (!_this5._animationChangeWithValidKeyframe(animationNames, prevAnimationNames)) {
classList.remove('au-leave-active');
classList.remove('au-leave');

_this5._removeMultipleEventListener(element, 'webkitAnimationEnd animationend', _animEnd2);
_this5._removeMultipleEventListener(element, 'webkitAnimationStart animationstart', _animStart2);

_this5._triggerDOMEvent(_aureliaTemplating.animationEvent.leaveTimeout, element);
resolve(false);
}
Expand Down Expand Up @@ -385,6 +404,9 @@ define(['exports', 'aurelia-templating', 'aurelia-pal'], function (exports, _aur
classList.remove(className + '-remove');
classList.remove(className);

_this6._removeMultipleEventListener(element, 'webkitAnimationEnd animationend', _animEnd3);
_this6._removeMultipleEventListener(element, 'webkitAnimationStart animationstart', _animStart3);

if (suppressEvents !== true) {
_this6._triggerDOMEvent(_aureliaTemplating.animationEvent.removeClassTimeout, element);
}
Expand Down Expand Up @@ -453,6 +475,9 @@ define(['exports', 'aurelia-templating', 'aurelia-pal'], function (exports, _aur
classList.remove(className + '-add');
classList.add(className);

_this7._removeMultipleEventListener(element, 'webkitAnimationEnd animationend', _animEnd4);
_this7._removeMultipleEventListener(element, 'webkitAnimationStart animationstart', _animStart4);

if (suppressEvents !== true) {
_this7._triggerDOMEvent(_aureliaTemplating.animationEvent.addClassTimeout, element);
}
Expand Down
36 changes: 35 additions & 1 deletion dist/aurelia-animator-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@ export class CssAnimator {
}
}

/**
* Remove multiple listeners at once from the given element
*
* @param el the element
* @param s collection of events to remove
* @param fn callback to remove
*/
_removeMultipleEventListener(el: HTMLElement, s: string, fn: Function) : void {
let evts = s.split(' ');
for (let i = 0, ii = evts.length; i < ii; ++i) {
el.removeEventListener(evts[i], fn, false);
}
}

/**
* Vendor-prefix save method to get the animation-delay
*
Expand Down Expand Up @@ -153,7 +167,13 @@ export class CssAnimator {

try {
for (let i = 0; i < styleSheets.length; ++i) {
let cssRules = styleSheets[i].cssRules;
let cssRules = null;

try {
cssRules = styleSheets[i].cssRules;
} catch (e) {
// do nothing
}

if (!cssRules) {
continue;
Expand Down Expand Up @@ -285,6 +305,10 @@ export class CssAnimator {
if (! this._animationChangeWithValidKeyframe(animationNames, prevAnimationNames)) {
classList.remove('au-enter-active');
classList.remove('au-enter');

this._removeMultipleEventListener(element, 'webkitAnimationEnd animationend', animEnd);
this._removeMultipleEventListener(element, 'webkitAnimationStart animationstart', animStart);

this._triggerDOMEvent(animationEvent.enterTimeout, element);
resolve(false);
}
Expand Down Expand Up @@ -389,6 +413,10 @@ export class CssAnimator {
if (! this._animationChangeWithValidKeyframe(animationNames, prevAnimationNames)) {
classList.remove('au-leave-active');
classList.remove('au-leave');

this._removeMultipleEventListener(element, 'webkitAnimationEnd animationend', animEnd);
this._removeMultipleEventListener(element, 'webkitAnimationStart animationstart', animStart);

this._triggerDOMEvent(animationEvent.leaveTimeout, element);
resolve(false);
}
Expand Down Expand Up @@ -492,6 +520,9 @@ export class CssAnimator {
classList.remove(className + '-remove');
classList.remove(className);

this._removeMultipleEventListener(element, 'webkitAnimationEnd animationend', animEnd);
this._removeMultipleEventListener(element, 'webkitAnimationStart animationstart', animStart);

if (suppressEvents !== true) {
this._triggerDOMEvent(animationEvent.removeClassTimeout, element);
}
Expand Down Expand Up @@ -572,6 +603,9 @@ export class CssAnimator {
classList.remove(className + '-add');
classList.add(className);

this._removeMultipleEventListener(element, 'webkitAnimationEnd animationend', animEnd);
this._removeMultipleEventListener(element, 'webkitAnimationStart animationstart', animStart);

if (suppressEvents !== true) {
this._triggerDOMEvent(animationEvent.addClassTimeout, element);
}
Expand Down
27 changes: 26 additions & 1 deletion dist/commonjs/aurelia-animator-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ var CssAnimator = exports.CssAnimator = function () {
}
};

CssAnimator.prototype._removeMultipleEventListener = function _removeMultipleEventListener(el, s, fn) {
var evts = s.split(' ');
for (var i = 0, ii = evts.length; i < ii; ++i) {
el.removeEventListener(evts[i], fn, false);
}
};

CssAnimator.prototype._getElementAnimationDelay = function _getElementAnimationDelay(element) {
var styl = _aureliaPal.DOM.getComputedStyle(element);
var prop = void 0;
Expand Down Expand Up @@ -114,7 +121,11 @@ var CssAnimator = exports.CssAnimator = function () {

try {
for (var i = 0; i < styleSheets.length; ++i) {
var cssRules = styleSheets[i].cssRules;
var cssRules = null;

try {
cssRules = styleSheets[i].cssRules;
} catch (e) {}

if (!cssRules) {
continue;
Expand Down Expand Up @@ -221,6 +232,10 @@ var CssAnimator = exports.CssAnimator = function () {
if (!_this4._animationChangeWithValidKeyframe(animationNames, prevAnimationNames)) {
classList.remove('au-enter-active');
classList.remove('au-enter');

_this4._removeMultipleEventListener(element, 'webkitAnimationEnd animationend', _animEnd);
_this4._removeMultipleEventListener(element, 'webkitAnimationStart animationstart', _animStart);

_this4._triggerDOMEvent(_aureliaTemplating.animationEvent.enterTimeout, element);
resolve(false);
}
Expand Down Expand Up @@ -303,6 +318,10 @@ var CssAnimator = exports.CssAnimator = function () {
if (!_this5._animationChangeWithValidKeyframe(animationNames, prevAnimationNames)) {
classList.remove('au-leave-active');
classList.remove('au-leave');

_this5._removeMultipleEventListener(element, 'webkitAnimationEnd animationend', _animEnd2);
_this5._removeMultipleEventListener(element, 'webkitAnimationStart animationstart', _animStart2);

_this5._triggerDOMEvent(_aureliaTemplating.animationEvent.leaveTimeout, element);
resolve(false);
}
Expand Down Expand Up @@ -388,6 +407,9 @@ var CssAnimator = exports.CssAnimator = function () {
classList.remove(className + '-remove');
classList.remove(className);

_this6._removeMultipleEventListener(element, 'webkitAnimationEnd animationend', _animEnd3);
_this6._removeMultipleEventListener(element, 'webkitAnimationStart animationstart', _animStart3);

if (suppressEvents !== true) {
_this6._triggerDOMEvent(_aureliaTemplating.animationEvent.removeClassTimeout, element);
}
Expand Down Expand Up @@ -456,6 +478,9 @@ var CssAnimator = exports.CssAnimator = function () {
classList.remove(className + '-add');
classList.add(className);

_this7._removeMultipleEventListener(element, 'webkitAnimationEnd animationend', _animEnd4);
_this7._removeMultipleEventListener(element, 'webkitAnimationStart animationstart', _animStart4);

if (suppressEvents !== true) {
_this7._triggerDOMEvent(_aureliaTemplating.animationEvent.addClassTimeout, element);
}
Expand Down
27 changes: 26 additions & 1 deletion dist/es2015/aurelia-animator-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ export let CssAnimator = class CssAnimator {
}
}

_removeMultipleEventListener(el, s, fn) {
let evts = s.split(' ');
for (let i = 0, ii = evts.length; i < ii; ++i) {
el.removeEventListener(evts[i], fn, false);
}
}

_getElementAnimationDelay(element) {
let styl = DOM.getComputedStyle(element);
let prop;
Expand Down Expand Up @@ -97,7 +104,11 @@ export let CssAnimator = class CssAnimator {

try {
for (let i = 0; i < styleSheets.length; ++i) {
let cssRules = styleSheets[i].cssRules;
let cssRules = null;

try {
cssRules = styleSheets[i].cssRules;
} catch (e) {}

if (!cssRules) {
continue;
Expand Down Expand Up @@ -198,6 +209,10 @@ export let CssAnimator = class CssAnimator {
if (!this._animationChangeWithValidKeyframe(animationNames, prevAnimationNames)) {
classList.remove('au-enter-active');
classList.remove('au-enter');

this._removeMultipleEventListener(element, 'webkitAnimationEnd animationend', animEnd);
this._removeMultipleEventListener(element, 'webkitAnimationStart animationstart', animStart);

this._triggerDOMEvent(animationEvent.enterTimeout, element);
resolve(false);
}
Expand Down Expand Up @@ -278,6 +293,10 @@ export let CssAnimator = class CssAnimator {
if (!this._animationChangeWithValidKeyframe(animationNames, prevAnimationNames)) {
classList.remove('au-leave-active');
classList.remove('au-leave');

this._removeMultipleEventListener(element, 'webkitAnimationEnd animationend', animEnd);
this._removeMultipleEventListener(element, 'webkitAnimationStart animationstart', animStart);

this._triggerDOMEvent(animationEvent.leaveTimeout, element);
resolve(false);
}
Expand Down Expand Up @@ -359,6 +378,9 @@ export let CssAnimator = class CssAnimator {
classList.remove(className + '-remove');
classList.remove(className);

this._removeMultipleEventListener(element, 'webkitAnimationEnd animationend', animEnd);
this._removeMultipleEventListener(element, 'webkitAnimationStart animationstart', animStart);

if (suppressEvents !== true) {
this._triggerDOMEvent(animationEvent.removeClassTimeout, element);
}
Expand Down Expand Up @@ -423,6 +445,9 @@ export let CssAnimator = class CssAnimator {
classList.remove(className + '-add');
classList.add(className);

this._removeMultipleEventListener(element, 'webkitAnimationEnd animationend', animEnd);
this._removeMultipleEventListener(element, 'webkitAnimationStart animationstart', animStart);

if (suppressEvents !== true) {
this._triggerDOMEvent(animationEvent.addClassTimeout, element);
}
Expand Down
27 changes: 26 additions & 1 deletion dist/native-modules/aurelia-animator-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ export var CssAnimator = function () {
}
};

CssAnimator.prototype._removeMultipleEventListener = function _removeMultipleEventListener(el, s, fn) {
var evts = s.split(' ');
for (var i = 0, ii = evts.length; i < ii; ++i) {
el.removeEventListener(evts[i], fn, false);
}
};

CssAnimator.prototype._getElementAnimationDelay = function _getElementAnimationDelay(element) {
var styl = DOM.getComputedStyle(element);
var prop = void 0;
Expand Down Expand Up @@ -105,7 +112,11 @@ export var CssAnimator = function () {

try {
for (var i = 0; i < styleSheets.length; ++i) {
var cssRules = styleSheets[i].cssRules;
var cssRules = null;

try {
cssRules = styleSheets[i].cssRules;
} catch (e) {}

if (!cssRules) {
continue;
Expand Down Expand Up @@ -212,6 +223,10 @@ export var CssAnimator = function () {
if (!_this4._animationChangeWithValidKeyframe(animationNames, prevAnimationNames)) {
classList.remove('au-enter-active');
classList.remove('au-enter');

_this4._removeMultipleEventListener(element, 'webkitAnimationEnd animationend', _animEnd);
_this4._removeMultipleEventListener(element, 'webkitAnimationStart animationstart', _animStart);

_this4._triggerDOMEvent(animationEvent.enterTimeout, element);
resolve(false);
}
Expand Down Expand Up @@ -294,6 +309,10 @@ export var CssAnimator = function () {
if (!_this5._animationChangeWithValidKeyframe(animationNames, prevAnimationNames)) {
classList.remove('au-leave-active');
classList.remove('au-leave');

_this5._removeMultipleEventListener(element, 'webkitAnimationEnd animationend', _animEnd2);
_this5._removeMultipleEventListener(element, 'webkitAnimationStart animationstart', _animStart2);

_this5._triggerDOMEvent(animationEvent.leaveTimeout, element);
resolve(false);
}
Expand Down Expand Up @@ -379,6 +398,9 @@ export var CssAnimator = function () {
classList.remove(className + '-remove');
classList.remove(className);

_this6._removeMultipleEventListener(element, 'webkitAnimationEnd animationend', _animEnd3);
_this6._removeMultipleEventListener(element, 'webkitAnimationStart animationstart', _animStart3);

if (suppressEvents !== true) {
_this6._triggerDOMEvent(animationEvent.removeClassTimeout, element);
}
Expand Down Expand Up @@ -447,6 +469,9 @@ export var CssAnimator = function () {
classList.remove(className + '-add');
classList.add(className);

_this7._removeMultipleEventListener(element, 'webkitAnimationEnd animationend', _animEnd4);
_this7._removeMultipleEventListener(element, 'webkitAnimationStart animationstart', _animStart4);

if (suppressEvents !== true) {
_this7._triggerDOMEvent(animationEvent.addClassTimeout, element);
}
Expand Down
Loading

0 comments on commit 979194e

Please sign in to comment.