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

Commit e3ff7c1

Browse files
committed
Add appendToBody option to uiSelectConfig.
1 parent 755765f commit e3ff7c1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/common.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ var uis = angular.module('ui.select', [])
9595
closeOnSelect: true,
9696
generateId: function() {
9797
return latestId++;
98-
}
98+
},
99+
appendToBody: false
99100
})
100101

101102
// See Rename minErr and make it accessible from outside https://github.com/angular/angular.js/issues/6913

src/uiSelectDirective.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,8 @@ uis.directive('uiSelect',
370370
});
371371

372372
// Support for appending the select field to the body when its open
373-
if (scope.$eval(attrs.appendToBody)) {
373+
var appendToBody = scope.$eval(attrs.appendToBody);
374+
if (appendToBody !== undefined ? appendToBody : uiSelectConfig.appendToBody) {
374375
scope.$watch('$select.open', function(isOpen) {
375376
if (isOpen) {
376377
positionDropdown();

0 commit comments

Comments
 (0)