From 17b156fa2ee63582f5dc578e28a143ee97f1cbe4 Mon Sep 17 00:00:00 2001 From: Valentyn Shybanov Date: Wed, 22 Jan 2014 18:31:19 +0200 Subject: [PATCH 1/2] fix(dropdown): use $animate for adding and removing classes --- src/dropdown/dropdown.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/dropdown/dropdown.js b/src/dropdown/dropdown.js index a14963426b..fcec4cba64 100644 --- a/src/dropdown/dropdown.js +++ b/src/dropdown/dropdown.js @@ -41,7 +41,7 @@ angular.module('ui.bootstrap.dropdown', []) }; }]) -.controller('DropdownController', ['$scope', '$attrs', 'dropdownConfig', 'dropdownService', function($scope, $attrs, dropdownConfig, dropdownService) { +.controller('DropdownController', ['$scope', '$attrs', 'dropdownConfig', 'dropdownService', function($scope, $attrs, dropdownConfig, dropdownService, $animate) { var self = this, openClass = dropdownConfig.openClass; this.init = function( element ) { @@ -54,7 +54,10 @@ angular.module('ui.bootstrap.dropdown', []) }; $scope.$watch('isOpen', function( value ) { - self.$element.toggleClass( openClass, value ); + if (value) + $animate.addClass(self.$element, openClass); + else + $animate.removeClass(self.$element, openClass); if ( value ) { dropdownService.open( $scope ); From bd84338e51f7ecb4cab4b297b23176bf619526f1 Mon Sep 17 00:00:00 2001 From: Valentyn Shybanov Date: Wed, 22 Jan 2014 18:31:19 +0200 Subject: [PATCH 2/2] fix(dropdown): use $animate for adding and removing classes --- src/dropdown/dropdown.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/dropdown/dropdown.js b/src/dropdown/dropdown.js index fcec4cba64..27fc2fb064 100644 --- a/src/dropdown/dropdown.js +++ b/src/dropdown/dropdown.js @@ -41,7 +41,7 @@ angular.module('ui.bootstrap.dropdown', []) }; }]) -.controller('DropdownController', ['$scope', '$attrs', 'dropdownConfig', 'dropdownService', function($scope, $attrs, dropdownConfig, dropdownService, $animate) { +.controller('DropdownController', ['$scope', '$attrs', 'dropdownConfig', 'dropdownService','$animate', function($scope, $attrs, dropdownConfig, dropdownService, $animate) { var self = this, openClass = dropdownConfig.openClass; this.init = function( element ) { @@ -54,10 +54,12 @@ angular.module('ui.bootstrap.dropdown', []) }; $scope.$watch('isOpen', function( value ) { - if (value) + if (value) { $animate.addClass(self.$element, openClass); - else + } + else { $animate.removeClass(self.$element, openClass); + } if ( value ) { dropdownService.open( $scope );