This repository was archived by the owner on Oct 2, 2019. It is now read-only.
File tree 3 files changed +32
-0
lines changed
3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -192,6 +192,22 @@ uis.directive('uiSelect',
192
192
throw uiSelectMinErr ( 'transcluded' , "Expected 1 .ui-select-choices but got '{0}'." , transcludedChoices . length ) ;
193
193
}
194
194
element . querySelectorAll ( '.ui-select-choices' ) . replaceWith ( transcludedChoices ) ;
195
+
196
+ var transcludedHeader = transcluded . querySelectorAll ( '.ui-select-header' ) ;
197
+ if ( transcludedHeader && transcludedHeader . length ) {
198
+ transcludedHeader . removeAttr ( 'ui-select-header' ) ; //To avoid loop in case directive as attr
199
+ transcludedHeader . removeAttr ( 'data-ui-select-header' ) ; // Properly handle HTML5 data-attributes
200
+ $timeout ( function ( ) {
201
+ transcludedChoices . prepend ( transcludedHeader ) ;
202
+ } ) ;
203
+ }
204
+
205
+ var transcludedFooter = transcluded . querySelectorAll ( '.ui-select-footer' ) ;
206
+ if ( transcludedFooter && transcludedFooter . length ) {
207
+ transcludedFooter . removeAttr ( 'ui-select-footer' ) ; //To avoid loop in case directive as attr
208
+ transcludedFooter . removeAttr ( 'data-ui-select-footer' ) ; // Properly handle HTML5 data-attributes
209
+ transcludedChoices . append ( transcludedFooter ) ;
210
+ }
195
211
} ) ;
196
212
197
213
// Support for appending the select field to the body when its open
Original file line number Diff line number Diff line change
1
+ uis . directive ( 'uiSelectFooter' , function ( ) {
2
+ return {
3
+ template : '<li class="ui-select-footer" ng-transclude></li>' ,
4
+ restrict : 'EA' ,
5
+ transclude : true ,
6
+ replace : true
7
+ } ;
8
+ } ) ;
Original file line number Diff line number Diff line change
1
+ uis . directive ( 'uiSelectHeader' , function ( ) {
2
+ return {
3
+ template : '<li class="ui-select-header" ng-transclude></li>' ,
4
+ restrict : 'EA' ,
5
+ transclude : true ,
6
+ replace : true
7
+ } ;
8
+ } ) ;
You can’t perform that action at this time.
0 commit comments