From 9fa31a1ec816c90fd003731888044e2e2d860057 Mon Sep 17 00:00:00 2001 From: Szymon Stasik Date: Mon, 25 Jul 2016 04:12:20 +0200 Subject: [PATCH] fix(animation): ele as string selector --- src/animations/animation.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/animations/animation.ts b/src/animations/animation.ts index 95a2326ba6..5313d93ceb 100644 --- a/src/animations/animation.ts +++ b/src/animations/animation.ts @@ -68,13 +68,13 @@ export class Animation { var i: number; if (ele) { - if (ele.length) { + if (typeof ele === 'string') { + ele = document.querySelectorAll(ele); for (i = 0; i < ele.length; i++) { this._addEle(ele[i]); } - } else if (typeof ele === 'string') { - ele = document.querySelectorAll(ele); + } else if (ele.length) { for (i = 0; i < ele.length; i++) { this._addEle(ele[i]); }