-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add an append-to-body attribute for improved layering. #718
Changes from 1 commit
7f1628f
391e081
a4e2f53
167325a
39c3f84
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,7 +108,7 @@ | |
} | ||
|
||
/* See Scrollable Menu with Bootstrap 3 http://stackoverflow.com/questions/19227496 */ | ||
.ui-select-bootstrap > .ui-select-choices { | ||
.ui-select-choices { | ||
width: 100%; | ||
height: auto; | ||
max-height: 200px; | ||
|
@@ -163,7 +163,7 @@ | |
border-right: 1px solid #428bca; | ||
} | ||
|
||
.ui-select-bootstrap .ui-select-choices-row>a { | ||
.ui-select-choices-row>a { | ||
display: block; | ||
padding: 3px 20px; | ||
clear: both; | ||
|
@@ -173,21 +173,21 @@ | |
white-space: nowrap; | ||
} | ||
|
||
.ui-select-bootstrap .ui-select-choices-row>a:hover, .ui-select-bootstrap .ui-select-choices-row>a:focus { | ||
.ui-select-choices-row>a:hover, .ui-select-choices-row>a:focus { | ||
text-decoration: none; | ||
color: #262626; | ||
background-color: #f5f5f5; | ||
} | ||
|
||
.ui-select-bootstrap .ui-select-choices-row.active>a { | ||
.ui-select-choices-row.active>a { | ||
color: #fff; | ||
text-decoration: none; | ||
outline: 0; | ||
background-color: #428bca; | ||
} | ||
|
||
.ui-select-bootstrap .ui-select-choices-row.disabled>a, | ||
.ui-select-bootstrap .ui-select-choices-row.active.disabled>a { | ||
.ui-select-choices-row.disabled>a, | ||
.ui-select-choices-row.active.disabled>a { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You mentioned in your PR that you only tested Bootstrap, removing the CSS class namespace would very likely have impact on the other themes, so please test them as well, seems likely this could cause a regression. |
||
color: #777; | ||
cursor: not-allowed; | ||
background-color: #fff; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,5 +133,25 @@ var uis = angular.module('ui.select', []) | |
return function(matchItem, query) { | ||
return query && matchItem ? matchItem.replace(new RegExp(escapeRegexp(query), 'gi'), '<span class="ui-select-highlight">$&</span>') : matchItem; | ||
}; | ||
}); | ||
}) | ||
|
||
/** | ||
* A read-only equivalent of jQuery's offset function: http://api.jquery.com/offset/ | ||
* | ||
* Taken from AngularUI Bootstrap Position: | ||
* See https://github.com/angular-ui/bootstrap/blob/master/src/position/position.js#L70 | ||
*/ | ||
.factory('uisOffset', | ||
['$document', '$window', | ||
function ($document, $window) { | ||
|
||
return function(element) { | ||
var boundingClientRect = element[0].getBoundingClientRect(); | ||
return { | ||
width: boundingClientRect.width || element.prop('offsetWidth'), | ||
height: boundingClientRect.height || element.prop('offsetHeight'), | ||
top: boundingClientRect.top + ($window.pageYOffset || $document[0].documentElement.scrollTop), | ||
left: boundingClientRect.left + ($window.pageXOffset || $document[0].documentElement.scrollLeft) | ||
}; | ||
}; | ||
}]); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks for keeping this lightweight 👍 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<ul class="ui-select-choices ui-select-choices-content select2-results"> | ||
<ul class="ui-select-choices ui-select-choices-content select2-results" | ||
ng-style="{top: position.top+'px', left: position.left+'px'}"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had the impression that you were making this directive "opt-in", meaning that it only impacts the directive if invoked. This gives me the opposite impression, can you explain a bit for me? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll back that out, it was a leftover from earlier experimentation. The styles are set in the |
||
<li class="ui-select-choices-group" ng-class="{'select2-result-with-children': $select.choiceGrouped($group) }"> | ||
<div ng-show="$select.choiceGrouped($group)" class="ui-select-choices-group-label select2-result-label" ng-bind="$group.name"></div> | ||
<ul role="listbox" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<div ng-show="$select.open" class="ui-select-choices selectize-dropdown single"> | ||
<div ng-show="$select.open" class="ui-select-choices selectize-dropdown single" | ||
ng-style="{top: position.top+'px', left: position.left+'px'}"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same question. |
||
<div class="ui-select-choices-content selectize-dropdown-content"> | ||
<div class="ui-select-choices-group optgroup" role="listbox"> | ||
<div ng-show="$select.isGrouped" class="ui-select-choices-group-label optgroup-header" ng-bind="$group.name"></div> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why this was changed? We have so many nuanced use cases for this project, I worry this could break the template for one of the many in our large array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll back that out, it isn't needed, and results in empty dropdown appearing with the Bootstrap theme.