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

Commit

Permalink
fix(dropdown): use $animate for adding and removing classes
Browse files Browse the repository at this point in the history
Closes #1644
  • Loading branch information
Valentyn Shybanov authored and bekos committed Feb 8, 2014
1 parent 0daa7a7 commit e8d5fef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dropdown/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', '$animate', function($scope, $attrs, dropdownConfig, dropdownService, $animate) {
var self = this, openClass = dropdownConfig.openClass;

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

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

if ( value ) {
dropdownService.open( $scope );
Expand Down

0 comments on commit e8d5fef

Please sign in to comment.