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

Commit b74c263

Browse files
committed
Revert "feat(typeahead): add customClass support for dropdown"
This reverts commit fa1cdfc.
1 parent fa1cdfc commit b74c263

File tree

4 files changed

+1
-45
lines changed

4 files changed

+1
-45
lines changed

Diff for: src/typeahead/docs/demo.html

-16
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
<style>
2-
.dropdown-menu.demo-class {
3-
border-radius: 0;
4-
font-style: italic;
5-
box-shadow: 5px 5px 0 rgba(0, 0, 0, .12);
6-
}
7-
.dropdown-menu.demo-class > .active > a,
8-
.dropdown-menu.demo-class > .active > a:hover,
9-
.dropdown-menu.demo-class > .active > a:focus {
10-
background-color: rgba(247, 150, 4, .69);
11-
}
12-
</style>
131
<script type="text/ng-template" id="customTemplate.html">
142
<a>
153
<img ng-src="http://upload.wikimedia.org/wikipedia/commons/thumb/{{match.model.flag}}" width="16">
@@ -33,8 +21,4 @@ <h4>Asynchronous results</h4>
3321
<h4>Custom templates for results</h4>
3422
<pre>Model: {{customSelected | json}}</pre>
3523
<input type="text" ng-model="customSelected" placeholder="Custom template" typeahead="state as state.name for state in statesWithFlags | filter:{name:$viewValue}" typeahead-template-url="customTemplate.html" class="form-control">
36-
37-
<h4>Custom class for append-to-body popup</h4>
38-
<pre>Model: {{customClassSelected | json}}</pre>
39-
<input type="text" ng-model="customClassSelected" typeahead-append-to-body="true" typeahead-dropdown-custom-class="demo-class" placeholder="Custom class" typeahead="state as state.name for state in statesWithFlags | filter:{name:$viewValue}" class="form-control">
4024
</div>

Diff for: src/typeahead/docs/readme.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,5 @@ The typeahead directives provide several attributes:
7373
On blur, select the currently highlighted match
7474

7575
* `typeahead-focus-on-select`
76-
_(Defaults: true)_ :
76+
_(Defaults: true) :
7777
On selection, focus the input element the typeahead directive is associated with
78-
79-
* `typeahead-dropdown-custom-class`
80-
_(Defaults: undefined)_ :
81-
Add custom class to popup

Diff for: src/typeahead/test/typeahead.spec.js

-19
Original file line numberDiff line numberDiff line change
@@ -595,19 +595,6 @@ describe('typeahead tests', function() {
595595
findMatches(element).eq(1).trigger('mouseenter');
596596
expect(element).toBeOpenWithActive(2, 1);
597597
});
598-
599-
it('should add a custom class to popup', function() {
600-
var element = prepareInputEl('<div><input ng-model="result" typeahead="item for item in source | filter:$viewValue" typeahead-dropdown-custom-class="demo-class"></div>');
601-
changeInputValueTo(element, 'b');
602-
expect(findDropDown(element).hasClass('demo-class')).toBeTruthy();
603-
});
604-
605-
it('should add a custom class to popup with custom template', function() {
606-
$templateCache.put('custom.html', '<div>foo</div>');
607-
var element = prepareInputEl('<div><input ng-model="result" typeahead="item for item in source | filter:$viewValue" typeahead-dropdown-custom-class="demo-class" typeahead-template-url="custom.html"></div>');
608-
changeInputValueTo(element, 'b');
609-
expect(findDropDown(element).hasClass('demo-class dropdown-menu')).toBeTruthy();
610-
});
611598
});
612599

613600
describe('promises', function() {
@@ -908,12 +895,6 @@ describe('typeahead tests', function() {
908895
$timeout.flush();
909896
expect(dropdown.css('top')).toEqual('500px');
910897
});
911-
912-
it('should add a custom class to append-to-body popup', function() {
913-
var element = prepareInputEl('<div><input ng-model="result" typeahead="item for item in source | filter:$viewValue" typeahead-append-to-body="true" typeahead-dropdown-custom-class="demo-class"></div>');
914-
changeInputValueTo(element, 'b');
915-
expect(findDropDown($document.find('body')).hasClass('demo-class')).toBeTruthy();
916-
});
917898
});
918899

919900
describe('focus first', function() {

Diff for: src/typeahead/typeahead.js

-5
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,6 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position'])
133133
popUpEl.attr('popup-template-url', attrs.typeaheadPopupTemplateUrl);
134134
}
135135

136-
// Add a custom class to Dropdown Menu element
137-
if (angular.isDefined(attrs.typeaheadDropdownCustomClass)) {
138-
popUpEl.addClass(attrs.typeaheadDropdownCustomClass);
139-
}
140-
141136
var resetMatches = function() {
142137
scope.matches = [];
143138
scope.activeIdx = -1;

0 commit comments

Comments
 (0)