This repository was archived by the owner on Oct 2, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 301301
302302 ctrl . setActiveItem = function ( item ) {
303303 ctrl . activeIndex = ctrl . items . indexOf ( item ) ;
304- ctrl . onHighlightCallback ( $scope , {
305- $item : item
306- } ) ;
307304 } ;
308305
309306 ctrl . isActive = function ( itemScope ) {
310- return ctrl . open && ctrl . items . indexOf ( itemScope [ ctrl . itemProperty ] ) === ctrl . activeIndex ;
307+ var isActive = ctrl . open && ctrl . items . indexOf ( itemScope [ ctrl . itemProperty ] ) === ctrl . activeIndex ;
308+
309+ if ( isActive && ! angular . isUndefined ( ctrl . onHighlightCallback ) ) {
310+ itemScope . $eval ( ctrl . onHighlightCallback ) ;
311+ }
312+
313+ return isActive ;
311314 } ;
312315
313316 ctrl . isDisabled = function ( itemScope ) {
608611
609612 $select . onSelectCallback = $parse ( attrs . onSelect ) ;
610613 $select . onRemoveCallback = $parse ( attrs . onRemove ) ;
611- $select . onHighlightCallback = $parse ( attrs . onHighlight ) ;
612614
613615 //From view --> model
614616 ngModel . $parsers . unshift ( function ( inputValue ) {
876878 $select . parseRepeatAttr ( attrs . repeat , groupByExp ) ; //Result ready at $select.parserResult
877879
878880 $select . disableChoiceExpression = attrs . uiDisableChoice ;
881+ $select . onHighlightCallback = attrs . onHighlight ;
879882
880883 if ( groupByExp ) {
881884 var groups = element . querySelectorAll ( '.ui-select-choices-group' ) ;
You can’t perform that action at this time.
0 commit comments