aboutsummaryrefslogtreecommitdiffstats
path: root/test/ng/directive/ngRepeatSpec.js
diff options
context:
space:
mode:
authorPete Bacon Darwin2013-04-23 12:34:53 +0100
committerPete Bacon Darwin2013-05-01 13:57:44 +0100
commit660605bdb834bbbb31529b86f5b870c5861ff497 (patch)
treeb9f2f276c9ad43527cbdddfc1de7f81f439f080d /test/ng/directive/ngRepeatSpec.js
parent89c0b5d096686aa0478dc5ca543acbf64223b688 (diff)
downloadangular.js-660605bdb834bbbb31529b86f5b870c5861ff497.tar.bz2
test(ngAnimate): also provide W3C transition property to work on IE10
Closes: #2492
Diffstat (limited to 'test/ng/directive/ngRepeatSpec.js')
-rw-r--r--test/ng/directive/ngRepeatSpec.js23
1 files changed, 11 insertions, 12 deletions
diff --git a/test/ng/directive/ngRepeatSpec.js b/test/ng/directive/ngRepeatSpec.js
index 4372f57a..fbd1a2dc 100644
--- a/test/ng/directive/ngRepeatSpec.js
+++ b/test/ng/directive/ngRepeatSpec.js
@@ -542,6 +542,11 @@ describe('ngRepeat ngAnimate', function() {
return element;
}
+ function applyCSS(element, cssProp, cssValue) {
+ element.css(cssProp, cssValue);
+ element.css(vendorPrefix + cssProp, cssValue);
+ }
+
beforeEach(function() {
// we need to run animation on attached elements;
body = jqLite(document.body);
@@ -577,12 +582,10 @@ describe('ngRepeat ngAnimate', function() {
$rootScope.$digest();
//if we add the custom css stuff here then it will get picked up before the animation takes place
- var cssProp = vendorPrefix + 'transition';
- var cssValue = '1s linear all';
var kids = element.children();
for(var i=0;i<kids.length;i++) {
kids[i] = jqLite(kids[i]);
- kids[i].css(cssProp, cssValue);
+ applyCSS(kids[i], 'transition', '1s linear all');
}
if ($sniffer.supportsTransitions) {
@@ -620,12 +623,10 @@ describe('ngRepeat ngAnimate', function() {
$rootScope.$digest();
//if we add the custom css stuff here then it will get picked up before the animation takes place
- var cssProp = vendorPrefix + 'transition';
- var cssValue = '1s linear all';
var kids = element.children();
for(var i=0;i<kids.length;i++) {
kids[i] = jqLite(kids[i]);
- kids[i].css(cssProp, cssValue);
+ applyCSS(kids[i], 'transition', '1s linear all');
}
$rootScope.items = ['1','3'];
@@ -660,12 +661,10 @@ describe('ngRepeat ngAnimate', function() {
$rootScope.$digest();
//if we add the custom css stuff here then it will get picked up before the animation takes place
- var cssProp = '-' + $sniffer.vendorPrefix + '-transition';
- var cssValue = '1s linear all';
var kids = element.children();
for(var i=0;i<kids.length;i++) {
kids[i] = jqLite(kids[i]);
- kids[i].css(cssProp, cssValue);
+ applyCSS(kids[i], 'transition', '1s linear all');
}
$rootScope.items = ['2','3','1'];
@@ -719,10 +718,10 @@ describe('ngRepeat ngAnimate', function() {
var kids = element.children();
var first = jqLite(kids[0]);
var second = jqLite(kids[1]);
- var cssProp = '-' + $sniffer.vendorPrefix + '-transition';
+ var cssProp = 'transition';
var cssValue = '0.5s linear all';
- first.css(cssProp, cssValue);
- second.css(cssProp, cssValue);
+ applyCSS(first, cssProp, cssValue);
+ applyCSS(second, cssProp, cssValue);
if ($sniffer.supportsTransitions) {
window.setTimeout.expect(1).process();