Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit 57556c9

Browse files
committed
feat(optionalAnimations): animations enabled by default
1 parent 689cbc5 commit 57556c9

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/ui-layout.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ angular.module('ui.layout', [])
679679
if(!element.hasClass('stretch')) element.addClass('stretch');
680680
if(!element.hasClass('ui-splitbar')) element.addClass('ui-splitbar');
681681

682-
if (ctrl.animate === 'true') {
682+
if (ctrl.animate !== 'false') {
683683
var animationClass = ctrl.isUsingColumnFlow ? 'animate-column' : 'animate-row';
684684
element.addClass(animationClass);
685685
}
@@ -921,7 +921,7 @@ angular.module('ui.layout', [])
921921
if(!element.hasClass('stretch')) element.addClass('stretch');
922922
if(!element.hasClass('ui-layout-container')) element.addClass('ui-layout-container');
923923

924-
if (ctrl.animate === 'true') {
924+
if (ctrl.animate !== 'false') {
925925
var animationClass = ctrl.isUsingColumnFlow ? 'animate-column' : 'animate-row';
926926
element.addClass(animationClass);
927927
}

test/uiLayoutContainer.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,16 @@ describe('Directive: uiLayoutContainer', function () {
7373
expect(angular.element(afterContainer).hasClass('animate-column')).toEqual(true);
7474
});
7575

76-
it('should not be animated when the attribute is not set', function() {
76+
it('should be animated when the attribute is not set', function() {
7777
element = createDirective({ beforeContainer: true, afterContainer: false});
7878
var divs = element.find('div'),
7979
beforeContainer = divs[0],
8080
afterContainer = divs[2];
81-
expect(angular.element(beforeContainer).hasClass('animate-column')).toEqual(false);
82-
expect(angular.element(afterContainer).hasClass('animate-column')).toEqual(false);
81+
expect(angular.element(beforeContainer).hasClass('animate-column')).toEqual(true);
82+
expect(angular.element(afterContainer).hasClass('animate-column')).toEqual(true);
8383
});
8484

85-
it('should not be animated when the attribute is set to a value different from true', function() {
85+
it('should not be animated when the attribute is set to false', function() {
8686
element = createDirective({ beforeContainer: true, afterContainer: false, animate: 'animate="false"'});
8787
var divs = element.find('div'),
8888
beforeContainer = divs[0],

0 commit comments

Comments
 (0)