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

Issue #3511 fixed #3513

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
- npm install

script: grunt

10 changes: 5 additions & 5 deletions src/dropdown/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,11 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position'])
});
}

$animate[isOpen ? 'addClass' : 'removeClass'](self.$element, openClass);

$animate[isOpen ? 'addClass' : 'removeClass'](self.$element, openClass).then(function() {
if (angular.isDefined(isOpen) && isOpen !== wasOpen) {
toggleInvoker($scope, { open: !!isOpen });
}
});
if ( isOpen ) {
scope.focusToggleElement();
dropdownService.open( scope );
Expand All @@ -138,9 +141,6 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position'])
}

setIsOpen($scope, isOpen);
if (angular.isDefined(isOpen) && isOpen !== wasOpen) {
toggleInvoker($scope, { open: !!isOpen });
}
});

$scope.$on('$locationChangeSuccess', function() {
Expand Down
7 changes: 5 additions & 2 deletions src/dropdown/test/dropdown.spec.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
describe('dropdownToggle', function() {
var $compile, $rootScope, $document, element;
var $compile, $rootScope, $document, element, $browser;

beforeEach(module('ui.bootstrap.dropdown'));

beforeEach(inject(function(_$compile_, _$rootScope_, _$document_) {
beforeEach(inject(function(_$compile_, _$rootScope_, _$document_, $browser) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use _$browser_ here

$compile = _$compile_;
$rootScope = _$rootScope_;
$document = _$document_;
$browser = $browser;
}));

afterEach(function() {
Expand All @@ -32,6 +33,8 @@ describe('dropdownToggle', function() {
function dropdown() {
return $compile('<li dropdown><a href dropdown-toggle></a><ul><li><a href>Hello</a></li></ul></li>')($rootScope);
}

$browser.defer.flush();

beforeEach(function() {
element = dropdown();
Expand Down