diff --git a/src/dropdown/dropdown.js b/src/dropdown/dropdown.js index 2b54e45026..2ed065136e 100644 --- a/src/dropdown/dropdown.js +++ b/src/dropdown/dropdown.js @@ -1,6 +1,7 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position']) .constant('uibDropdownConfig', { + appendToOpenClass: 'uib-dropdown-open', openClass: 'open' }) @@ -69,6 +70,7 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position']) var self = this, scope = $scope.$new(), // create a child scope so we are not polluting original one templateScope, + appendToOpenClass = dropdownConfig.appendToOpenClass, openClass = dropdownConfig.openClass, getIsOpen, setIsOpen = angular.noop, @@ -216,7 +218,7 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position']) var openContainer = appendTo ? appendTo : $element; - $animate[isOpen ? 'addClass' : 'removeClass'](openContainer, openClass).then(function() { + $animate[isOpen ? 'addClass' : 'removeClass'](openContainer, appendTo ? appendToOpenClass : openClass).then(function() { if (angular.isDefined(isOpen) && isOpen !== wasOpen) { toggleInvoker($scope, { open: !!isOpen }); } diff --git a/src/dropdown/test/dropdown.spec.js b/src/dropdown/test/dropdown.spec.js index 06ba9322ca..4209deea1e 100644 --- a/src/dropdown/test/dropdown.spec.js +++ b/src/dropdown/test/dropdown.spec.js @@ -261,11 +261,11 @@ describe('dropdownToggle', function() { it('toggles open class on container', function() { var container = $document.find('#dropdown-container'); - expect(container.hasClass('open')).toBe(false); + expect(container.hasClass('uib-dropdown-open')).toBe(false); element.find('[uib-dropdown-toggle]').click(); - expect(container.hasClass('open')).toBe(true); + expect(container.hasClass('uib-dropdown-open')).toBe(true); element.find('[uib-dropdown-toggle]').click(); - expect(container.hasClass('open')).toBe(false); + expect(container.hasClass('uib-dropdown-open')).toBe(false); }); it('removes the menu when the dropdown is removed', function() { @@ -481,11 +481,11 @@ describe('dropdownToggle', function() { element = $compile('