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

Commit 9a0fc24

Browse files
committed
Change selectByGroups to simple array with values and use GetGroupLabel for the naming
1 parent b735f14 commit 9a0fc24

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/angularjs-dropdown-multiselect.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)