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

Commit

Permalink
chore(dropdown): remove class support
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Class support for consuming the directive has been
removed. Please use an attribute instead
  • Loading branch information
wesleycho committed Nov 28, 2015
1 parent 12a37e0 commit 43535cf
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/dropdown/docs/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<a href id="simple-dropdown" uib-dropdown-toggle>
Click me for a dropdown, yo!
</a>
<ul class="uib-dropdown-menu" aria-labelledby="simple-dropdown">
<ul uib-dropdown-menu aria-labelledby="simple-dropdown">
<li ng-repeat="choice in items">
<a href>{{choice}}</a>
</li>
Expand All @@ -17,7 +17,7 @@
<button id="single-button" type="button" class="btn btn-primary" uib-dropdown-toggle ng-disabled="disabled">
Button dropdown <span class="caret"></span>
</button>
<ul class="uib-dropdown-menu" role="menu" aria-labelledby="single-button">
<ul uib-dropdown-menu role="menu" aria-labelledby="single-button">
<li role="menuitem"><a href="#">Action</a></li>
<li role="menuitem"><a href="#">Another action</a></li>
<li role="menuitem"><a href="#">Something else here</a></li>
Expand All @@ -33,7 +33,7 @@
<span class="caret"></span>
<span class="sr-only">Split button!</span>
</button>
<ul class="uib-dropdown-menu" role="menu" aria-labelledby="split-button">
<ul uib-dropdown-menu role="menu" aria-labelledby="split-button">
<li role="menuitem"><a href="#">Action</a></li>
<li role="menuitem"><a href="#">Another action</a></li>
<li role="menuitem"><a href="#">Something else here</a></li>
Expand All @@ -47,7 +47,7 @@
<button id="btn-append-to-body" type="button" class="btn btn-primary" uib-dropdown-toggle>
Dropdown on Body <span class="caret"></span>
</button>
<ul class="uib-dropdown-menu" role="menu" aria-labelledby="btn-append-to-body">
<ul uib-dropdown-menu role="menu" aria-labelledby="btn-append-to-body">
<li role="menuitem"><a href="#">Action</a></li>
<li role="menuitem"><a href="#">Another action</a></li>
<li role="menuitem"><a href="#">Something else here</a></li>
Expand All @@ -61,7 +61,7 @@
<button id="button-template-url" type="button" class="btn btn-primary" uib-dropdown-toggle ng-disabled="disabled">
Dropdown using template <span class="caret"></span>
</button>
<ul class="uib-dropdown-menu" template-url="dropdown.html" aria-labelledby="button-template-url">
<ul uib-dropdown-menu template-url="dropdown.html" aria-labelledby="button-template-url">
</ul>
</div>

Expand All @@ -77,7 +77,7 @@
<button id="simple-btn-keyboard-nav" type="button" class="btn btn-primary" uib-dropdown-toggle>
Dropdown with keyboard navigation <span class="caret"></span>
</button>
<ul class="uib-dropdown-menu" role="menu" aria-labelledby="simple-btn-keyboard-nav">
<ul uib-dropdown-menu role="menu" aria-labelledby="simple-btn-keyboard-nav">
<li role="menuitem"><a href="#">Action</a></li>
<li role="menuitem"><a href="#">Another action</a></li>
<li role="menuitem"><a href="#">Something else here</a></li>
Expand Down
2 changes: 2 additions & 0 deletions src/dropdown/docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ This directive is composed by three parts:
* `uib-dropdown-toggle` which allows the dropdown to be toggled via click. This directive is optional.
* `uib-dropdown-menu` which transforms a node into the popup menu.

Each of these parts need to be used as attribute directives.

### uib-dropdown settings

* `append-to`
Expand Down
2 changes: 1 addition & 1 deletion src/dropdown/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position'])

.directive('uibDropdownMenu', function() {
return {
restrict: 'AC',
restrict: 'A',
require: '?^uibDropdown',
link: function(scope, element, attrs, dropdownCtrl) {
if (!dropdownCtrl || angular.isDefined(attrs.dropdownNested)) {
Expand Down
10 changes: 5 additions & 5 deletions src/dropdown/test/dropdown.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ describe('uib-dropdown', function() {
function dropdown() {
$templateCache.put('custom.html', '<ul class="uib-dropdown-menu"><li>Item 1</li></ul>');

return $compile('<li uib-dropdown><a href uib-dropdown-toggle></a><ul class="uib-dropdown-menu" template-url="custom.html"></ul></li>')($rootScope);
return $compile('<li uib-dropdown><a href uib-dropdown-toggle></a><ul uib-dropdown-menu template-url="custom.html"></ul></li>')($rootScope);
}

beforeEach(function() {
Expand All @@ -210,7 +210,7 @@ describe('uib-dropdown', function() {

describe('using dropdown-append-to-body', function() {
function dropdown() {
return $compile('<li uib-dropdown dropdown-append-to-body><a href uib-dropdown-toggle></a><ul class="uib-dropdown-menu" id="dropdown-menu"><li><a href>Hello On Body</a></li></ul></li>')($rootScope);
return $compile('<li uib-dropdown dropdown-append-to-body><a href uib-dropdown-toggle></a><ul uib-dropdown-menu id="dropdown-menu"><li><a href>Hello On Body</a></li></ul></li>')($rootScope);
}

beforeEach(function() {
Expand Down Expand Up @@ -355,7 +355,7 @@ describe('uib-dropdown', function() {
beforeEach(function() {
$rootScope.toggleHandler = jasmine.createSpy('toggleHandler');
$rootScope.isopen = false;
element = $compile('<li uib-dropdown on-toggle="toggleHandler(open)" is-open="isopen"><a uib-dropdown-toggle></a><ul><li>Hello</li></ul></li>')($rootScope);
element = $compile('<li uib-dropdown on-toggle="toggleHandler(open)" is-open="isopen"><a uib-dropdown-toggle></a><ul><li>Hello</li></ul></li>')($rootScope);
$rootScope.$digest();
});

Expand Down Expand Up @@ -536,7 +536,7 @@ describe('uib-dropdown', function() {
});

it('should work with dropdown-append-to-body', function() {
element = $compile('<li uib-dropdown dropdown-append-to-body auto-close="outsideClick"><a href uib-dropdown-toggle></a><ul class="uib-dropdown-menu" id="dropdown-menu"><li><a href>Hello On Body</a></li></ul></li>')($rootScope);
element = $compile('<li uib-dropdown dropdown-append-to-body auto-close="outsideClick"><a href uib-dropdown-toggle></a><ul uib-dropdown-menu id="dropdown-menu"><li><a href>Hello On Body</a></li></ul></li>')($rootScope);
clickDropdownToggle();
var dropdownMenu = $document.find('#dropdown-menu');
expect(dropdownMenu.parent()).toHaveClass(dropdownConfig.appendToOpenClass);
Expand Down Expand Up @@ -661,7 +661,7 @@ describe('uib-dropdown', function() {

describe('with dropdown-append-to-body', function() {
function dropdown() {
return $compile('<li uib-dropdown dropdown-append-to-body keyboard-nav><a href uib-dropdown-toggle></a><ul class="uib-dropdown-menu" id="dropdown-menu"><li><a href>Hello On Body</a></li><li><a href>Hello Again</a></li></ul></li>')($rootScope);
return $compile('<li uib-dropdown dropdown-append-to-body keyboard-nav><a href uib-dropdown-toggle></a><ul uib-dropdown-menu id="dropdown-menu"><li><a href>Hello On Body</a></li><li><a href>Hello Again</a></li></ul></li>')($rootScope);
}

beforeEach(function() {
Expand Down

0 comments on commit 43535cf

Please sign in to comment.