@@ -34,11 +34,11 @@ directiveModule.directive('ngDropdownMultiselect', ['$filter', '$document', '$co
3434 template += '<li ng-if="settings.showCheckAll && settings.selectionLimit !== 1"><a ng-keydown="keyDownLink($event)" data-ng-click="selectAll()" tabindex="-1" id="selectAll"><span class="glyphicon glyphicon-ok"></span> {{texts.checkAll}}</a>' ;
3535 template += '<li ng-if="settings.showUncheckAll"><a ng-keydown="keyDownLink($event)" data-ng-click="deselectAll();" tabindex="-1" id="deselectAll"><span class="glyphicon glyphicon-remove"></span> {{texts.uncheckAll}}</a></li>' ;
3636 template += '<li ng-if="settings.selectByGroups && ((settings.showCheckAll && settings.selectionLimit > 0) || settings.showUncheckAll)" class="divider"></li>' ;
37- template += '<li ng-repeat="currentGroup in settings.selectByGroups track by $index" ng-click="selectCurrentGroup(currentGroup)"><a ng-class="{\'dropdown-selected-group\': selectedGroup === currentGroup.value }" tabindex="-1">{{::texts.selectGroup}} {{::currentGroup.label }}</a></li>' ;
38- template += '<li ng-if="settings.selectByGroups" class="divider"></li>' ;
37+ template += '<li ng-repeat="currentGroup in settings.selectByGroups track by $index" ng-click="selectCurrentGroup(currentGroup)"><a ng-class="{\'dropdown-selected-group\': selectedGroup === currentGroup}" tabindex="-1">{{::texts.selectGroup}} {{::getGroupLabel( currentGroup) }}</a></li>' ;
38+ template += '<li ng-if="settings.selectByGroups && settings.showEnableSearchButton " class="divider"></li>' ;
3939 template += '<li ng-if="settings.showEnableSearchButton && settings.enableSearch"><a ng-keydown="keyDownLink($event); keyDownToggleSearch();" ng-click="toggleSearch($event);" tabindex="-1">{{texts.disableSearch}}</a></li>' ;
40- template += '<li ng-if="settings.showEnableSearchButton && !settings.enableSearch"><a ng-keydown="keyDownLink($event); keyDownToggleSearch();" ng-click="toggleSearch($event);" tabindex="-1">{{texts.enableSearch}}</a></li>' ;
41- template += '<li ng-if="(settings.showCheckAll && settings.selectionLimit > 0) || settings.showUncheckAll || settings.showEnableSearchButton" class="divider"></li>' ;
40+ template += '<li ng-if="settings.showEnableSearchButton && !settings.enableSearch"><a ng-keydown="keyDownLink($event); keyDownToggleSearch();" ng-click="toggleSearch($event);" tabindex="-1">{{texts.enableSearch}}</a></li>' ;
41+ template += '<li ng-if="(settings.showCheckAll && settings.selectionLimit > 0) || settings.showUncheckAll || settings.showEnableSearchButton" class="divider"></li>' ;
4242 template += '<li ng-if="settings.enableSearch"><div class="dropdown-header"><input type="text" class="form-control searchField" ng-keydown="keyDownSearchDefault($event); keyDownSearch($event, input.searchFilter);" ng-style="{width: \'100%\'}" ng-model="input.searchFilter" placeholder="{{texts.searchPlaceholder}}" /></li>' ;
4343 template += '<li ng-if="settings.enableSearch" class="divider"></li>' ;
4444
@@ -165,7 +165,7 @@ directiveModule.directive('ngDropdownMultiselect', ['$filter', '$document', '$co
165165 $scope . selectedModel . splice ( 0 , $scope . selectedModel . length ) ;
166166 if ( $scope . orderedItems ) {
167167 $scope . orderedItems . forEach ( function ( item ) {
168- if ( item [ $scope . groupBy ] === currentGroup . value ) {
168+ if ( item [ $scope . groupBy ] === currentGroup ) {
169169 $scope . setSelectedItem ( $scope . getPropertyForObject ( item , $scope . settings . idProp ) , false , false )
170170 }
171171 } ) ;
0 commit comments