From e8d5fefcff794fce28c16c638d9f7baa624c7809 Mon Sep 17 00:00:00 2001 From: Valentyn Shybanov Date: Wed, 22 Jan 2014 18:31:19 +0200 Subject: [PATCH] fix(dropdown): use $animate for adding and removing classes Closes #1644 --- src/dropdown/dropdown.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dropdown/dropdown.js b/src/dropdown/dropdown.js index f89b7f2c75..4dfb4f217c 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', '$animate', function($scope, $attrs, dropdownConfig, dropdownService, $animate) { var self = this, openClass = dropdownConfig.openClass; this.init = function( element ) { @@ -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 );