Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit e8d5fef

Browse files
Valentyn Shybanovbekos
Valentyn Shybanov
authored andcommitted
fix(dropdown): use $animate for adding and removing classes
Closes #1644
1 parent 0daa7a7 commit e8d5fef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/dropdown/dropdown.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ angular.module('ui.bootstrap.dropdown', [])
4141
};
4242
}])
4343

44-
.controller('DropdownController', ['$scope', '$attrs', 'dropdownConfig', 'dropdownService', function($scope, $attrs, dropdownConfig, dropdownService) {
44+
.controller('DropdownController', ['$scope', '$attrs', 'dropdownConfig', 'dropdownService', '$animate', function($scope, $attrs, dropdownConfig, dropdownService, $animate) {
4545
var self = this, openClass = dropdownConfig.openClass;
4646

4747
this.init = function( element ) {
@@ -59,7 +59,7 @@ angular.module('ui.bootstrap.dropdown', [])
5959
};
6060

6161
$scope.$watch('isOpen', function( value ) {
62-
self.$element.toggleClass( openClass, value );
62+
$animate[value ? 'addClass' : 'removeClass'](self.$element, openClass);
6363

6464
if ( value ) {
6565
dropdownService.open( $scope );

0 commit comments

Comments
 (0)